# HG changeset patch # User Richard M. Stallman # Date 756609858 0 # Node ID eed870591987098347d18352f08df96b096f0411 # Parent f12fe7f21c2dc54f81aa7198e85d5a76bf500a2b (Fprocess_status): Use get_process, not Fget_process. [BROKEN_O_NONBLOCK]: Undefine O_NONBLOCK. (create_process): Delete SYSV4_PTYS code. (deactivate_process): Likewise. (create_process) [SET_CHILD_PTY_PGRP]: Do ioctls to set the pgrp of the pty. (wait_reading_process_input): Call prepare_menu_bars. diff -r f12fe7f21c2d -r eed870591987 src/process.c --- a/src/process.c Thu Dec 23 01:22:23 1993 +0000 +++ b/src/process.c Thu Dec 23 01:24:18 1993 +0000 @@ -67,6 +67,10 @@ #endif /* HAVE_PTYS and no O_NDELAY */ #endif /* BSD or STRIDE */ +#ifdef BROKEN_O_NONBLOCK +#undef O_NONBLOCK +#endif /* BROKEN_O_NONBLOCK */ + #ifdef NEED_BSDTTY #include #endif @@ -586,7 +590,7 @@ { register struct Lisp_Process *p; register Lisp_Object status; - proc = Fget_process (proc); + proc = get_process (proc); if (NILP (proc)) return proc; p = XPROCESS (proc); @@ -1264,11 +1268,20 @@ This makes the pty the controlling terminal of the subprocess. */ if (pty_flag) { +#ifdef SET_CHILD_PTY_PGRP + int pgrp = getpid (); +#endif + /* I wonder if close (open (pty_name, ...)) would work? */ if (xforkin >= 0) close (xforkin); xforkout = xforkin = open (pty_name, O_RDWR, 0); +#ifdef SET_CHILD_PTY_PGRP + ioctl (xforkin, TIOCSPGRP, &pgrp); + ioctl (xforkout, TIOCSPGRP, &pgrp); +#endif + if (xforkin < 0) abort (); } @@ -1318,20 +1331,9 @@ stop_polling (); signal (SIGALRM, create_process_1); alarm (1); -#ifdef SYSV4_PTYS - /* OK to close only if it's not a pty. Otherwise we need to leave - it open for ioctl to get pgrp when signals are sent, or to send - the interrupt characters through if that's how we're signalling - subprocesses. Alternately if you are concerned about running out - of file descriptors, you could just save the tty name and open - just to do the ioctl. */ - if (NILP (XFASTINT (XPROCESS (process)->pty_flag))) -#endif - { - XPROCESS (process)->subtty = Qnil; - if (forkin >= 0) - close (forkin); - } + XPROCESS (process)->subtty = Qnil; + if (forkin >= 0) + close (forkin); alarm (0); start_polling (); if (forkin != forkout && forkout >= 0) @@ -1524,10 +1526,6 @@ close (inchannel); if (outchannel >= 0 && outchannel != inchannel) close (outchannel); -#ifdef SYSV4_PTYS - if (!NILP (p->subtty)) - close (XINT (p->subtty)); -#endif #endif XSET (p->infd, Lisp_Int, -1); @@ -1710,6 +1708,10 @@ EMACS_ADD_TIME (end_time, end_time, timeout); } + /* It would not be safe to call this below, + where we call redisplay_preserve_echo_area. */ + prepare_menu_bars (); + while (1) { /* If calling from keyboard input, do not quit @@ -3137,6 +3139,9 @@ /* It's infinite. */ timeout_p = 0; + /* This must come before stop_polling. */ + prepare_menu_bars (); + /* Turn off periodic alarms (in case they are in use) because the select emulator uses alarms. */ stop_polling ();