summaryrefslogtreecommitdiff
path: root/src/emacs.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1993-06-02 19:11:58 +0000
committerRichard M. Stallman <rms@gnu.org>1993-06-02 19:11:58 +0000
commit2144fd18d270986e5be627583eae6cfc15a6698d (patch)
treea8c3980a4a577bb6a976eb6eb7d1d725ac4d7c16 /src/emacs.c
parent11281034b72ad4335290d46a979dae8ce82c289e (diff)
downloademacs-2144fd18d270986e5be627583eae6cfc15a6698d.tar.gz
emacs-2144fd18d270986e5be627583eae6cfc15a6698d.tar.bz2
emacs-2144fd18d270986e5be627583eae6cfc15a6698d.zip
(shut_down_emacs): Handle GETPGRP_NO_ARG.
(main) [BSD]: Delete the setpgrp (both times).
Diffstat (limited to 'src/emacs.c')
-rw-r--r--src/emacs.c19
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)
#endif
clearerr (stdin);
+#if 0 /* Without EMACS_SET_TTY_PGRP, this causes Emacs to hang
+ when run under a non-job-control shell.
+ EMACS_SET_TTY_PGRP seems correct, but breaks even more. */
#ifdef BSD
- setpgrp (0, getpid ());
+ {
+ int pid = getpid ();
+ setpgrp (0, pid);
+ EMACS_SET_TTY_PGRP (0, &pid);
+ }
+#endif
#endif
#ifdef APOLLO
@@ -323,11 +331,6 @@ main (argc, argv, envp)
setuid (getuid ());
#endif /* PRIO_PROCESS */
-#ifdef BSD
- /* interrupt_input has trouble if we aren't in a separate process group. */
- setpgrp (getpid (), getpid ());
-#endif
-
inhibit_window_system = 0;
/* Handle the -t switch, which specifies filename to use as terminal */
@@ -677,7 +680,11 @@ shut_down_emacs (sig, no_x)
{
int tpgrp;
if (EMACS_GET_TTY_PGRP (0, &tpgrp) != -1
+#ifdef GETPGRP_NO_ARG
+ && tpgrp == getpgrp ())
+#else
&& tpgrp == getpgrp (0))
+#endif
{
fflush (stdout);
reset_sys_modes ();