- case -1: /* cannot fork */
- return -1; /* errno already set */
-
- case 0: /* child process */
-
- /* Cheap hack to set mode of new directory. Since this child
- process is going away anyway, we zap its umask. This won't
- suffice to set SUID, SGID, etc. on this directory, so the parent
- process calls chmod afterward. */
-
- status = umask (0);
- umask (status | (0777 & ~dmode));
- execl ("/bin/mkdir", "mkdir", dpath, (char *) 0);
- _exit (1);
-
- default: /* parent process */
-
- /* Wait for kid to finish. */
-
- while (wait (&status) != cpid)
- /* Do nothing. */ ;