aboutsummaryrefslogtreecommitdiffstats
path: root/src/callproc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/callproc.c')
-rw-r--r--src/callproc.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/src/callproc.c b/src/callproc.c
index b33882e54c2..c236f22fc86 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -64,13 +64,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
64#include "nsterm.h" 64#include "nsterm.h"
65#endif 65#endif
66 66
67#ifdef HAVE_SETPGID
68#if !defined (USG)
69#undef setpgrp
70#define setpgrp setpgid
71#endif
72#endif
73
74/* Pattern used by call-process-region to make temp files. */ 67/* Pattern used by call-process-region to make temp files. */
75static Lisp_Object Vtemp_file_name_pattern; 68static Lisp_Object Vtemp_file_name_pattern;
76 69
@@ -618,14 +611,12 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
618 { 611 {
619 if (fd[0] >= 0) 612 if (fd[0] >= 0)
620 emacs_close (fd[0]); 613 emacs_close (fd[0]);
614
621#ifdef HAVE_SETSID 615#ifdef HAVE_SETSID
622 setsid (); 616 setsid ();
623#endif
624#if defined (USG)
625 setpgrp ();
626#else 617#else
627 setpgrp (pid, pid); 618 setpgid (0, 0);
628#endif /* USG */ 619#endif
629 620
630 /* Emacs ignores SIGPIPE, but the child should not. */ 621 /* Emacs ignores SIGPIPE, but the child should not. */
631 signal (SIGPIPE, SIG_DFL); 622 signal (SIGPIPE, SIG_DFL);
@@ -1295,13 +1286,9 @@ child_setup (int in, int out, int err, char **new_argv, bool set_pgrp,
1295 if (err != in && err != out) 1286 if (err != in && err != out)
1296 emacs_close (err); 1287 emacs_close (err);
1297 1288
1298#if defined (USG) 1289#if defined HAVE_SETPGID || ! (defined USG && defined SETPGRP_RELEASES_CTTY)
1299#ifndef SETPGRP_RELEASES_CTTY 1290 setpgid (pid, pid);
1300 setpgrp (); /* No arguments but equivalent in this case */
1301#endif 1291#endif
1302#else /* not USG */
1303 setpgrp (pid, pid);
1304#endif /* not USG */
1305 1292
1306 /* setpgrp_of_tty is incorrect here; it uses input_fd. */ 1293 /* setpgrp_of_tty is incorrect here; it uses input_fd. */
1307 tcsetpgrp (0, pid); 1294 tcsetpgrp (0, pid);