Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site utah-gr.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!utah-cs!utah-gr!thomas From: thomas@utah-gr.UUCP (Spencer W. Thomas) Newsgroups: net.emacs Subject: Re: requests Message-ID: <1575@utah-gr.UUCP> Date: Tue, 27-Aug-85 13:45:45 EDT Article-I.D.: utah-gr.1575 Posted: Tue Aug 27 13:45:45 1985 Date-Received: Thu, 29-Aug-85 23:24:38 EDT References: <291@CS-Mordred> <1403@umcp-cs.UUCP> Reply-To: thomas@utah-gr.UUCP (Spencer W. Thomas) Organization: Univ of Utah CS Dept Lines: 60 In article <1403@umcp-cs.UUCP> chris@umcp-cs.UUCP (Chris Torek) writes: >>... There's one incredibly annoying bug which keeps cropping up: >>when emacs exits (normally) it often leaves the loadst process >>hanging around on the pty it grabbed. > > I believe (but have not tried) >setting it only once, but after doing TIOCSETD, suffices. I sent our fix for this problem to the original poster. You are right, that you only need it once. Where you need to put it is AFTER the TIOCNOTTY. If you carefully follow the ttyopen code in the kernel, you will see why. In any case, here are context diffs from our source (your line numbers will probably differ). RCS file: RCS/pchan.c,v retrieving revision 1.11 retrieving revision 1.12 diff -c -r1.11 -r1.12 *** /tmp/,RCSt1022961 Mon Aug 26 14:59:40 1985 --- /tmp/,RCSt2022961 Mon Aug 26 14:59:47 1985 *************** *** 165,171 #endif close (channel); sigrelse (SIGCHLD); - setpgrp (0, getpid ()); sigsys (SIGINT, SIG_DFL); sigsys (SIGQUIT, SIG_DFL); if ((ld = open ("/dev/tty", 2)) >= 0) { --- 165,170 ----- #endif close (channel); sigrelse (SIGCHLD); sigsys (SIGINT, SIG_DFL); sigsys (SIGQUIT, SIG_DFL); if ((ld = open ("/dev/tty", 2)) >= 0) { *************** *** 179,184 } pgrp = getpid(); ioctl (2, TIOCSPGRP, &pgrp); close (0); close (1); dup (2); --- 178,184 ----- } pgrp = getpid(); ioctl (2, TIOCSPGRP, &pgrp); + setpgrp( 0, pgrp ); /* must go after the NOTTY */ close (0); close (1); dup (2); -- =Spencer ({ihnp4,decvax}!utah-cs!thomas, thomas@utah-cs.ARPA) "To feel at home, stay at home. A foreign country is not designed to make [one] comfortable. It's designed to make its own people comfortable." Clifton Fadiman