diff options
| author | Richard M. Stallman | 1993-06-02 19:11:58 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-06-02 19:11:58 +0000 |
| commit | 2144fd18d270986e5be627583eae6cfc15a6698d (patch) | |
| tree | a8c3980a4a577bb6a976eb6eb7d1d725ac4d7c16 /src | |
| parent | 11281034b72ad4335290d46a979dae8ce82c289e (diff) | |
| download | emacs-2144fd18d270986e5be627583eae6cfc15a6698d.tar.gz emacs-2144fd18d270986e5be627583eae6cfc15a6698d.zip | |
(shut_down_emacs): Handle GETPGRP_NO_ARG.
(main) [BSD]: Delete the setpgrp (both times).
Diffstat (limited to 'src')
| -rw-r--r-- | src/emacs.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/emacs.c b/src/emacs.c index e24b51e06e1..285911bf15d 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -292,8 +292,16 @@ main (argc, argv, envp) | |||
| 292 | #endif | 292 | #endif |
| 293 | 293 | ||
| 294 | clearerr (stdin); | 294 | clearerr (stdin); |
| 295 | #if 0 /* Without EMACS_SET_TTY_PGRP, this causes Emacs to hang | ||
| 296 | when run under a non-job-control shell. | ||
| 297 | EMACS_SET_TTY_PGRP seems correct, but breaks even more. */ | ||
| 295 | #ifdef BSD | 298 | #ifdef BSD |
| 296 | setpgrp (0, getpid ()); | 299 | { |
| 300 | int pid = getpid (); | ||
| 301 | setpgrp (0, pid); | ||
| 302 | EMACS_SET_TTY_PGRP (0, &pid); | ||
| 303 | } | ||
| 304 | #endif | ||
| 297 | #endif | 305 | #endif |
| 298 | 306 | ||
| 299 | #ifdef APOLLO | 307 | #ifdef APOLLO |
| @@ -323,11 +331,6 @@ main (argc, argv, envp) | |||
| 323 | setuid (getuid ()); | 331 | setuid (getuid ()); |
| 324 | #endif /* PRIO_PROCESS */ | 332 | #endif /* PRIO_PROCESS */ |
| 325 | 333 | ||
| 326 | #ifdef BSD | ||
| 327 | /* interrupt_input has trouble if we aren't in a separate process group. */ | ||
| 328 | setpgrp (getpid (), getpid ()); | ||
| 329 | #endif | ||
| 330 | |||
| 331 | inhibit_window_system = 0; | 334 | inhibit_window_system = 0; |
| 332 | 335 | ||
| 333 | /* Handle the -t switch, which specifies filename to use as terminal */ | 336 | /* Handle the -t switch, which specifies filename to use as terminal */ |
| @@ -677,7 +680,11 @@ shut_down_emacs (sig, no_x) | |||
| 677 | { | 680 | { |
| 678 | int tpgrp; | 681 | int tpgrp; |
| 679 | if (EMACS_GET_TTY_PGRP (0, &tpgrp) != -1 | 682 | if (EMACS_GET_TTY_PGRP (0, &tpgrp) != -1 |
| 683 | #ifdef GETPGRP_NO_ARG | ||
| 684 | && tpgrp == getpgrp ()) | ||
| 685 | #else | ||
| 680 | && tpgrp == getpgrp (0)) | 686 | && tpgrp == getpgrp (0)) |
| 687 | #endif | ||
| 681 | { | 688 | { |
| 682 | fflush (stdout); | 689 | fflush (stdout); |
| 683 | reset_sys_modes (); | 690 | reset_sys_modes (); |