changeset 1030:9934251d8219

(WCOREDUMP): Define only if not defined. (create_process) [HAVE_SETSID]: Use TIOCSCTTY if exists.
author Richard M. Stallman <rms@gnu.org>
date Sat, 22 Aug 1992 02:53:24 +0000
parents 425f62908a54
children 2b11e85880d3
files src/process.c
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/process.c	Fri Aug 21 23:45:45 1992 +0000
+++ b/src/process.c	Sat Aug 22 02:53:24 1992 +0000
@@ -125,8 +125,10 @@
 #define WIFEXITED(w) ((w&0377) == 0)
 #define WRETCODE(w) (w >> 8)
 #define WSTOPSIG(w) (w >> 8)
+#define WTERMSIG(w) (w & 0377)
+#ifndef WCOREDUMP
 #define WCOREDUMP(w) ((w&0200) != 0)
-#define WTERMSIG(w) (w & 0377)
+#endif
 #else 
 #ifdef BSD4_1
 #include <wait.h>
@@ -1206,6 +1208,11 @@
 	/* 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