diff options
| author | Richard M. Stallman | 1993-12-23 01:24:18 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-12-23 01:24:18 +0000 |
| commit | 99e3d726dc0b8ca7d6b9617d8036dd2512168808 (patch) | |
| tree | 1c70e1e14b6b1dd2656a918d15d83c10f8b2f07c /src/process.c | |
| parent | 53b6ab286b83624cae9f8ffc4e6372b664d6029f (diff) | |
| download | emacs-99e3d726dc0b8ca7d6b9617d8036dd2512168808.tar.gz emacs-99e3d726dc0b8ca7d6b9617d8036dd2512168808.zip | |
(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.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/src/process.c b/src/process.c index 408a2579ef0..5d798786171 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -67,6 +67,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 67 | #endif /* HAVE_PTYS and no O_NDELAY */ | 67 | #endif /* HAVE_PTYS and no O_NDELAY */ |
| 68 | #endif /* BSD or STRIDE */ | 68 | #endif /* BSD or STRIDE */ |
| 69 | 69 | ||
| 70 | #ifdef BROKEN_O_NONBLOCK | ||
| 71 | #undef O_NONBLOCK | ||
| 72 | #endif /* BROKEN_O_NONBLOCK */ | ||
| 73 | |||
| 70 | #ifdef NEED_BSDTTY | 74 | #ifdef NEED_BSDTTY |
| 71 | #include <bsdtty.h> | 75 | #include <bsdtty.h> |
| 72 | #endif | 76 | #endif |
| @@ -586,7 +590,7 @@ nil, indicating the current buffer's process.") | |||
| 586 | { | 590 | { |
| 587 | register struct Lisp_Process *p; | 591 | register struct Lisp_Process *p; |
| 588 | register Lisp_Object status; | 592 | register Lisp_Object status; |
| 589 | proc = Fget_process (proc); | 593 | proc = get_process (proc); |
| 590 | if (NILP (proc)) | 594 | if (NILP (proc)) |
| 591 | return proc; | 595 | return proc; |
| 592 | p = XPROCESS (proc); | 596 | p = XPROCESS (proc); |
| @@ -1264,11 +1268,20 @@ create_process (process, new_argv, current_dir) | |||
| 1264 | This makes the pty the controlling terminal of the subprocess. */ | 1268 | This makes the pty the controlling terminal of the subprocess. */ |
| 1265 | if (pty_flag) | 1269 | if (pty_flag) |
| 1266 | { | 1270 | { |
| 1271 | #ifdef SET_CHILD_PTY_PGRP | ||
| 1272 | int pgrp = getpid (); | ||
| 1273 | #endif | ||
| 1274 | |||
| 1267 | /* I wonder if close (open (pty_name, ...)) would work? */ | 1275 | /* I wonder if close (open (pty_name, ...)) would work? */ |
| 1268 | if (xforkin >= 0) | 1276 | if (xforkin >= 0) |
| 1269 | close (xforkin); | 1277 | close (xforkin); |
| 1270 | xforkout = xforkin = open (pty_name, O_RDWR, 0); | 1278 | xforkout = xforkin = open (pty_name, O_RDWR, 0); |
| 1271 | 1279 | ||
| 1280 | #ifdef SET_CHILD_PTY_PGRP | ||
| 1281 | ioctl (xforkin, TIOCSPGRP, &pgrp); | ||
| 1282 | ioctl (xforkout, TIOCSPGRP, &pgrp); | ||
| 1283 | #endif | ||
| 1284 | |||
| 1272 | if (xforkin < 0) | 1285 | if (xforkin < 0) |
| 1273 | abort (); | 1286 | abort (); |
| 1274 | } | 1287 | } |
| @@ -1318,20 +1331,9 @@ create_process (process, new_argv, current_dir) | |||
| 1318 | stop_polling (); | 1331 | stop_polling (); |
| 1319 | signal (SIGALRM, create_process_1); | 1332 | signal (SIGALRM, create_process_1); |
| 1320 | alarm (1); | 1333 | alarm (1); |
| 1321 | #ifdef SYSV4_PTYS | 1334 | XPROCESS (process)->subtty = Qnil; |
| 1322 | /* OK to close only if it's not a pty. Otherwise we need to leave | 1335 | if (forkin >= 0) |
| 1323 | it open for ioctl to get pgrp when signals are sent, or to send | 1336 | close (forkin); |
| 1324 | the interrupt characters through if that's how we're signalling | ||
| 1325 | subprocesses. Alternately if you are concerned about running out | ||
| 1326 | of file descriptors, you could just save the tty name and open | ||
| 1327 | just to do the ioctl. */ | ||
| 1328 | if (NILP (XFASTINT (XPROCESS (process)->pty_flag))) | ||
| 1329 | #endif | ||
| 1330 | { | ||
| 1331 | XPROCESS (process)->subtty = Qnil; | ||
| 1332 | if (forkin >= 0) | ||
| 1333 | close (forkin); | ||
| 1334 | } | ||
| 1335 | alarm (0); | 1337 | alarm (0); |
| 1336 | start_polling (); | 1338 | start_polling (); |
| 1337 | if (forkin != forkout && forkout >= 0) | 1339 | if (forkin != forkout && forkout >= 0) |
| @@ -1524,10 +1526,6 @@ deactivate_process (proc) | |||
| 1524 | close (inchannel); | 1526 | close (inchannel); |
| 1525 | if (outchannel >= 0 && outchannel != inchannel) | 1527 | if (outchannel >= 0 && outchannel != inchannel) |
| 1526 | close (outchannel); | 1528 | close (outchannel); |
| 1527 | #ifdef SYSV4_PTYS | ||
| 1528 | if (!NILP (p->subtty)) | ||
| 1529 | close (XINT (p->subtty)); | ||
| 1530 | #endif | ||
| 1531 | #endif | 1529 | #endif |
| 1532 | 1530 | ||
| 1533 | XSET (p->infd, Lisp_Int, -1); | 1531 | XSET (p->infd, Lisp_Int, -1); |
| @@ -1710,6 +1708,10 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 1710 | EMACS_ADD_TIME (end_time, end_time, timeout); | 1708 | EMACS_ADD_TIME (end_time, end_time, timeout); |
| 1711 | } | 1709 | } |
| 1712 | 1710 | ||
| 1711 | /* It would not be safe to call this below, | ||
| 1712 | where we call redisplay_preserve_echo_area. */ | ||
| 1713 | prepare_menu_bars (); | ||
| 1714 | |||
| 1713 | while (1) | 1715 | while (1) |
| 1714 | { | 1716 | { |
| 1715 | /* If calling from keyboard input, do not quit | 1717 | /* If calling from keyboard input, do not quit |
| @@ -3137,6 +3139,9 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 3137 | /* It's infinite. */ | 3139 | /* It's infinite. */ |
| 3138 | timeout_p = 0; | 3140 | timeout_p = 0; |
| 3139 | 3141 | ||
| 3142 | /* This must come before stop_polling. */ | ||
| 3143 | prepare_menu_bars (); | ||
| 3144 | |||
| 3140 | /* Turn off periodic alarms (in case they are in use) | 3145 | /* Turn off periodic alarms (in case they are in use) |
| 3141 | because the select emulator uses alarms. */ | 3146 | because the select emulator uses alarms. */ |
| 3142 | stop_polling (); | 3147 | stop_polling (); |