dissociate from old session, tty
authorMike Karels <karels@ucbvax.Berkeley.EDU>
Sat, 30 Jun 1990 10:45:44 +0000 (02:45 -0800)
committerMike Karels <karels@ucbvax.Berkeley.EDU>
Sat, 30 Jun 1990 10:45:44 +0000 (02:45 -0800)
SCCS-vsn: sbin/newfs/mkfs.c 6.15

usr/src/sbin/newfs/mkfs.c

index 29ce0cd..577f5b4 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)mkfs.c     6.14 (Berkeley) %G%";
+static char sccsid[] = "@(#)mkfs.c     6.15 (Berkeley) %G%";
 #endif /* not lint */
 
 #ifndef STANDALONE
 #endif /* not lint */
 
 #ifndef STANDALONE
@@ -604,9 +604,16 @@ next:
        pp->p_cpg = sblock.fs_cpg;
        /*
         * Notify parent process of success.
        pp->p_cpg = sblock.fs_cpg;
        /*
         * Notify parent process of success.
+        * Dissociate from session and tty.
         */
         */
-       if (mfs)
+       if (mfs) {
                kill(ppid, SIGUSR1);
                kill(ppid, SIGUSR1);
+               (void) setsid();
+               (void) close(0);
+               (void) close(1);
+               (void) close(2);
+               (void) chdir("/");
+       }
 }
 
 /*
 }
 
 /*