MFS - Clean up debug code, remove stuff no longer needed for DEVFS
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 17 Aug 2009 04:00:20 +0000 (21:00 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 17 Aug 2009 04:00:20 +0000 (21:00 -0700)
sbin/newfs/mkfs.c
sbin/newfs/newfs.c

index 80bfbb6..4e3350c 100644 (file)
@@ -199,7 +199,7 @@ mkfs(char *fsys, int fi, int fo, const char *mfscopy)
                            copyroot = FSCopy(&copyhlinks, mfscopy);
                        signal(SIGUSR1, started);
                        kill(child, SIGUSR1);
-                       while (waitpid(child, &status, WNOHANG) != child)
+                       while (waitpid(child, &status, 0) != child)
                                ;
                        exit(WEXITSTATUS(status));
                        /* NOTREACHED */
@@ -760,14 +760,19 @@ next:
        /*
         * Notify parent process of success.
         * Dissociate from session and tty.
+        *
+        * NOTE: We are the child and may receive a SIGINT due
+        *       to losing the tty session? XXX
         */
        if (mfs) {
+               /* YYY */
                kill(mfs_ppid, SIGUSR1);
                setsid();
                close(0);
                close(1);
                close(2);
                chdir("/");
+               /* returns to mount_mfs (newfs) and issues the mount */
        }
 }
 
index 966362f..d80a202 100644 (file)
@@ -598,7 +598,8 @@ havelabel:
 #ifdef MFS
        if (mfs) {
                struct mfs_args args;
-               int udev;
+
+               bzero(&args, sizeof(args));
 
                snprintf(mfsdevname, sizeof(mfsdevname), "/dev/mfs%d",
                        getpid());
@@ -621,10 +622,13 @@ havelabel:
                if (error)
                        fatal("mfs filesystem not available");
 
+#if 0
+               int udev;
                udev = (253 << 8) | (getpid() & 255) | 
                        ((getpid() & ~0xFF) << 8);
                if (mknod(mfsdevname, S_IFCHR | 0700, udev) < 0)
                        printf("Warning: unable to create %s\n", mfsdevname);
+#endif
                signal(SIGINT, mfsintr);
                if (mount(vfc.vfc_name, argv[1], mntflags, &args) < 0)
                        fatal("%s: %s", argv[1], strerror(errno));
@@ -642,7 +646,9 @@ mfsintr(__unused int signo)
 {
        if (filename)
                munmap(membase, fssize * sectorsize);
+#if 0
        remove(mfsdevname);
+#endif
 }
 
 #endif