diff src/process.c @ 6975:b7411e378b65

(create_process): Call setsid only if pty_flag.
author Richard M. Stallman <rms@gnu.org>
date Wed, 20 Apr 1994 03:49:47 +0000
parents c5f990fad6bb
children 89f37ab7b781
line wrap: on
line diff
--- a/src/process.c	Wed Apr 20 03:04:46 1994 +0000
+++ b/src/process.c	Wed Apr 20 03:49:47 1994 +0000
@@ -1274,14 +1274,16 @@
 #ifdef HAVE_PTYS
 	/* First, disconnect its current controlling terminal.  */
 #ifdef HAVE_SETSID
-	setsid ();
-#ifdef TIOCSCTTY
 	/* Make the pty's terminal the controlling terminal.  */
 	if (pty_flag)
-	  /* We ignore the return value
-	     because faith@cs.unc.edu says that is necessary on Linux.  */
-	  ioctl (xforkin, TIOCSCTTY, 0);
+	  {
+	    setsid ();
+#ifdef TIOCSCTTY
+	    /* We ignore the return value
+	       because faith@cs.unc.edu says that is necessary on Linux.  */
+	    ioctl (xforkin, TIOCSCTTY, 0);
 #endif
+	  }
 #else /* not HAVE_SETSID */
 #ifdef USG
 	/* It's very important to call setpgrp here and no time