summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1992-08-22 02:53:24 +0000
committerRichard M. Stallman <rms@gnu.org>1992-08-22 02:53:24 +0000
commitce4c9c9080cbab12a6097b6bcc2e77662668ce8c (patch)
treedaf73d0811191027b095b4ab1e3e1d42bc487f7e
parentd418ef42e13d633b305d351c7a4555052f732aa8 (diff)
downloademacs-ce4c9c9080cbab12a6097b6bcc2e77662668ce8c.tar.gz
(WCOREDUMP): Define only if not defined.
(create_process) [HAVE_SETSID]: Use TIOCSCTTY if exists.
-rw-r--r--src/process.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/process.c b/src/process.c
index dd9c6dbcb42..55ee3373c50 100644
--- a/src/process.c
+++ b/src/process.c
@@ -125,8 +125,10 @@ static Lisp_Object stream_process;
#define WIFEXITED(w) ((w&0377) == 0)
#define WRETCODE(w) (w >> 8)
#define WSTOPSIG(w) (w >> 8)
-#define WCOREDUMP(w) ((w&0200) != 0)
#define WTERMSIG(w) (w & 0377)
+#ifndef WCOREDUMP
+#define WCOREDUMP(w) ((w&0200) != 0)
+#endif
#else
#ifdef BSD4_1
#include <wait.h>
@@ -1206,6 +1208,11 @@ create_process (process, new_argv)
/* First, disconnect its current controlling terminal. */
#ifdef HAVE_SETSID
setsid ();
+#ifdef TIOCSCTTY
+ /* Make the pty's terminal the controlling terminal. */
+ if (pty_flag && (ioctl (xforkin, TIOCSCTTY, 0) < 0))
+ abort ();
+#endif
#else /* not HAVE_SETSID */
#ifdef USG
/* It's very important to call setpgrp() here and no time