diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-03-23 22:40:53 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-03-23 22:40:53 +0000 |
commit | d93272132860e23ef33b4081f9937b934c0b615c (patch) | |
tree | 61887f6e6f1a45246086f7193d6592e36edbad05 /lib | |
parent | 415ecd9582b3f286227c3821d0cd18934121aa85 (diff) |
do not wait if vfork() fails
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libutil/passwd.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libutil/passwd.c b/lib/libutil/passwd.c index a411e70d16c..3158e0168b4 100644 --- a/lib/libutil/passwd.c +++ b/lib/libutil/passwd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: passwd.c,v 1.16 1997/11/18 19:57:28 millert Exp $ */ +/* $OpenBSD: passwd.c,v 1.17 1998/03/23 22:40:52 deraadt Exp $ */ /* * Copyright (c) 1987, 1993, 1994, 1995 @@ -34,7 +34,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: passwd.c,v 1.16 1997/11/18 19:57:28 millert Exp $"; +static char rcsid[] = "$OpenBSD: passwd.c,v 1.17 1998/03/23 22:40:52 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -279,6 +279,8 @@ pw_mkdb() } pid = vfork(); + if (pid == -1) + return (-1); if (pid == 0) { if (pw_lck) execl(_PATH_PWD_MKDB, "pwd_mkdb", "-p", "-d", pw_dir, |