summaryrefslogtreecommitdiff
path: root/sbin/init/init.c
diff options
context:
space:
mode:
authordsl <dsl@NetBSD.org>2003-08-05 09:31:48 +0000
committerdsl <dsl@NetBSD.org>2003-08-05 09:31:48 +0000
commit9b8239809b2b46fac393b2a52de976e3eef3fa31 (patch)
tree7a9ba164f739763dc0e449d1c66fb8163eb3c6ba /sbin/init/init.c
parent20a37f96276c193024ea6a389705840c533ca499 (diff)
Exit child process if we fail to 'cd /dev' or 'execl sh MAKEDEV'.
Don't really want two processes in the rest of init!
Diffstat (limited to 'sbin/init/init.c')
-rw-r--r--sbin/init/init.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/sbin/init/init.c b/sbin/init/init.c
index 9571527c763..5b686c599d7 100644
--- a/sbin/init/init.c
+++ b/sbin/init/init.c
@@ -1,4 +1,4 @@
-/* $NetBSD: init.c,v 1.59 2003/07/12 14:46:41 itojun Exp $ */
+/* $NetBSD: init.c,v 1.60 2003/08/05 09:31:48 dsl Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 1993\n"
#if 0
static char sccsid[] = "@(#)init.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: init.c,v 1.59 2003/07/12 14:46:41 itojun Exp $");
+__RCSID("$NetBSD: init.c,v 1.60 2003/08/05 09:31:48 dsl Exp $");
#endif
#endif /* not lint */
@@ -1446,26 +1446,24 @@ mfs_dev(void)
/* Run the makedev script to create devices */
switch ((pid = fork())) {
case 0:
- if (chdir("/dev") == -1)
- goto fail;
- (void)execl(INIT_BSHELL, "sh", "./MAKEDEV", "init", NULL);
- goto fail;
+ if (chdir("/dev") == 0)
+ (void)execl(INIT_BSHELL, "sh", "./MAKEDEV", "init",
+ NULL);
+ _exit(1);
case -1:
- goto fail;
+ break;
default:
if (waitpid(pid, &status, 0) == -1)
- goto fail;
+ break;
if (status != 0) {
errno = EINVAL;
- goto fail;
+ break;
}
- break;
+ return 0;
}
- return(0);
-fail:
warn("Unable to run MAKEDEV");
- return(-1);
+ return (-1);
}
#endif