/[emacs]/emacs/src/process.c
ViewVC logotype

Diff of /emacs/src/process.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.376 by raeburn, Mon Jul 15 00:00:37 2002 UTC revision 1.377 by rms, Tue Jul 16 13:41:16 2002 UTC
# Line 1562  create_process (process, new_argv, curre Line 1562  create_process (process, new_argv, curre
1562    
1563    if (inchannel >= 0)    if (inchannel >= 0)
1564      {      {
1565  #ifndef USG  #if ! defined (USG) || defined (USG_SUBTTY_WORKS)
1566        /* On USG systems it does not work to open the pty's tty here        /* On most USG systems it does not work to open the pty's tty here,
1567                 and then close and reopen it in the child.  */           then close it and reopen it in the child.  */
1568  #ifdef O_NOCTTY  #ifdef O_NOCTTY
1569        /* Don't let this terminal become our controlling terminal        /* Don't let this terminal become our controlling terminal
1570           (in case we don't have one).  */           (in case we don't have one).  */
# Line 1576  create_process (process, new_argv, curre Line 1576  create_process (process, new_argv, curre
1576          report_file_error ("Opening pty", Qnil);          report_file_error ("Opening pty", Qnil);
1577  #else  #else
1578        forkin = forkout = -1;        forkin = forkout = -1;
1579  #endif /* not USG */  #endif /* not USG, or USG_SUBTTY_WORKS */
1580        pty_flag = 1;        pty_flag = 1;
1581      }      }
1582    else    else
# Line 5027  process_send_signal (process, signo, cur Line 5027  process_send_signal (process, signo, cur
5027      current_group = Qnil;      current_group = Qnil;
5028    
5029    /* If we are using pgrps, get a pgrp number and make it negative.  */    /* If we are using pgrps, get a pgrp number and make it negative.  */
5030    if (!NILP (current_group))    if (NILP (current_group))
5031        /* Send the signal to the shell's process group.  */
5032        gid = XFASTINT (p->pid);
5033      else
5034      {      {
5035  #ifdef SIGNALS_VIA_CHARACTERS  #ifdef SIGNALS_VIA_CHARACTERS
5036        /* If possible, send signals to the entire pgrp        /* If possible, send signals to the entire pgrp
# Line 5122  process_send_signal (process, signo, cur Line 5125  process_send_signal (process, signo, cur
5125  #endif /* defined (SIGNALS_VIA_CHARACTERS) */  #endif /* defined (SIGNALS_VIA_CHARACTERS) */
5126    
5127  #ifdef TIOCGPGRP  #ifdef TIOCGPGRP
5128        /* Get the pgrp using the tty itself, if we have that.        /* Get the current pgrp using the tty itself, if we have that.
5129           Otherwise, use the pty to get the pgrp.           Otherwise, use the pty to get the pgrp.
5130           On pfa systems, saka@pfu.fujitsu.co.JP writes:           On pfa systems, saka@pfu.fujitsu.co.JP writes:
5131           "TIOCGPGRP symbol defined in sys/ioctl.h at E50.           "TIOCGPGRP symbol defined in sys/ioctl.h at E50.
# Line 5137  process_send_signal (process, signo, cur Line 5140  process_send_signal (process, signo, cur
5140          else          else
5141            err = ioctl (XINT (p->infd), TIOCGPGRP, &gid);            err = ioctl (XINT (p->infd), TIOCGPGRP, &gid);
5142    
 #ifdef pfa  
5143          if (err == -1)          if (err == -1)
5144            gid = - XFASTINT (p->pid);            /* If we can't get the information, assume
5145  #endif /* ! defined (pfa) */               the shell owns the tty.  */
5146              gid = XFASTINT (p->pid);
5147        }        }
5148    
5149          /* It is not clear whether anything really can set GID to -1.
5150             Perhaps on some system one of those ioctls can or could do so.
5151             Or perhaps this is vestigial.  */
5152        if (gid == -1)        if (gid == -1)
5153          no_pgrp = 1;          no_pgrp = 1;
       else  
         gid = - gid;  
5154  #else  /* ! defined (TIOCGPGRP ) */  #else  /* ! defined (TIOCGPGRP ) */
5155        /* Can't select pgrps on this system, so we know that        /* Can't select pgrps on this system, so we know that
5156           the child itself heads the pgrp.  */           the child itself heads the pgrp.  */
5157        gid = - XFASTINT (p->pid);        gid = XFASTINT (p->pid);
5158  #endif /* ! defined (TIOCGPGRP ) */  #endif /* ! defined (TIOCGPGRP ) */
5159    
5160        /* If current_group is lambda, and the shell owns the terminal,        /* If current_group is lambda, and the shell owns the terminal,
5161           don't send any signal.  */           don't send any signal.  */
5162        if (EQ (current_group, Qlambda) && gid == - XFASTINT (p->pid))        if (EQ (current_group, Qlambda) && gid == XFASTINT (p->pid))
5163          return;          return;
5164      }      }
   else  
     gid = - XFASTINT (p->pid);  
5165    
5166    switch (signo)    switch (signo)
5167      {      {
# Line 5210  process_send_signal (process, signo, cur Line 5213  process_send_signal (process, signo, cur
5213        kill (gid, signo);        kill (gid, signo);
5214      }      }
5215  #else /* ! defined (TIOCSIGSEND) */  #else /* ! defined (TIOCSIGSEND) */
5216    EMACS_KILLPG (-gid, signo);    EMACS_KILLPG (gid, signo);
5217  #endif /* ! defined (TIOCSIGSEND) */  #endif /* ! defined (TIOCSIGSEND) */
5218  }  }
5219    

Legend:
Removed from v.1.376  
changed lines
  Added in v.1.377

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26