aboutsummaryrefslogtreecommitdiffstats
path: root/src/callproc.c
diff options
context:
space:
mode:
authorPaul Eggert2012-11-04 19:18:32 -0800
committerPaul Eggert2012-11-04 19:18:32 -0800
commitdd0333b6155c9c3aabdac9418c005e2e5b4796e7 (patch)
tree6239cffc67b6a7b0e8eb594c22ed92a4cd28b2fc /src/callproc.c
parent8148369cfba2c982a87fb4eb72d024e26e193a03 (diff)
downloademacs-dd0333b6155c9c3aabdac9418c005e2e5b4796e7.tar.gz
emacs-dd0333b6155c9c3aabdac9418c005e2e5b4796e7.zip
Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid.
This removes code that has been obsolete since around 1990. * admin/CPP-DEFINES (HAVE_SETPGID, HAVE_SETSID, SETPGRP_RELEASES_CTTY): Remove; obsolete. * configure.ac (setpgid, setsid): Assume their existence. (AC_FUNC_GETPGRP, SETPGRP_RELEASES_CTTY): Remove; obsolete. * src/callproc.c (Fcall_process): * src/emacs.c (main): * src/process.c (create_process): * src/term.c (dissociate_if_controlling_tty): Assume setsid exists. * src/callproc.c (child_setup): Assume setpgid exists and behaves as per POSIX.1-1988 or later. * src/conf_post.h (setpgid) [!HAVE_SETPGID]: Remove. * src/emacs.c (shut_down_emacs): * src/sysdep.c (sys_suspend, init_foreground_group): Assume getpgrp behaves as per POSIX.1-1998 or later. * src/msdos.c (setpgrp): Remove. (tcgetpgrp, setpgid, setsid): New functions. * src/systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp. * src/term.c (no_controlling_tty): Remove; unused. * src/w32proc.c (setpgrp): Remove. (setsid, tcgetpgrp): New functions. Fixes: debbugs:12800
Diffstat (limited to 'src/callproc.c')
-rw-r--r--src/callproc.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/callproc.c b/src/callproc.c
index c236f22fc86..c7bbe36e605 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -612,11 +612,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
612 if (fd[0] >= 0) 612 if (fd[0] >= 0)
613 emacs_close (fd[0]); 613 emacs_close (fd[0]);
614 614
615#ifdef HAVE_SETSID
616 setsid (); 615 setsid ();
617#else
618 setpgid (0, 0);
619#endif
620 616
621 /* Emacs ignores SIGPIPE, but the child should not. */ 617 /* Emacs ignores SIGPIPE, but the child should not. */
622 signal (SIGPIPE, SIG_DFL); 618 signal (SIGPIPE, SIG_DFL);
@@ -1286,11 +1282,7 @@ child_setup (int in, int out, int err, char **new_argv, bool set_pgrp,
1286 if (err != in && err != out) 1282 if (err != in && err != out)
1287 emacs_close (err); 1283 emacs_close (err);
1288 1284
1289#if defined HAVE_SETPGID || ! (defined USG && defined SETPGRP_RELEASES_CTTY) 1285 setpgid (0, 0);
1290 setpgid (pid, pid);
1291#endif
1292
1293 /* setpgrp_of_tty is incorrect here; it uses input_fd. */
1294 tcsetpgrp (0, pid); 1286 tcsetpgrp (0, pid);
1295 1287
1296 /* execvp does not accept an environment arg so the only way 1288 /* execvp does not accept an environment arg so the only way