Don't delete the lock file if pwd_mkdb fails. The caller will take care

of it by calling pw_abort() or pw_error() as appropriate.
This commit is contained in:
ghudson 1996-06-02 19:25:43 +00:00
parent 2fadbc363c
commit e257708bf2
1 changed files with 2 additions and 4 deletions

View File

@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char rcsid[] = "$NetBSD: passwd.c,v 1.1 1996/05/15 21:42:31 jtc Exp $";
static char rcsid[] = "$NetBSD: passwd.c,v 1.2 1996/06/02 19:25:43 ghudson Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@ -87,10 +87,8 @@ pw_mkdb()
exit(1);
}
pid = waitpid(pid, &pstat, 0);
if (pid == -1 || !WIFEXITED(pstat) || WEXITSTATUS(pstat) != 0) {
unlink(_PATH_MASTERPASSWD_LOCK);
if (pid == -1 || !WIFEXITED(pstat) || WEXITSTATUS(pstat) != 0)
return(-1);
}
return(0);
}