summaryrefslogtreecommitdiff
path: root/lib/libutil/passwd.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libutil/passwd.c')
-rw-r--r--lib/libutil/passwd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libutil/passwd.c b/lib/libutil/passwd.c
index c3dc4ece8bf..94703156aed 100644
--- a/lib/libutil/passwd.c
+++ b/lib/libutil/passwd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: passwd.c,v 1.47 2006/04/02 02:10:35 deraadt Exp $ */
+/* $OpenBSD: passwd.c,v 1.48 2006/12/17 20:50:51 ray Exp $ */
/*
* Copyright (c) 1987, 1993, 1994, 1995
@@ -95,8 +95,10 @@ pw_lock(int retries)
mode_t old_mode;
int save_errno;
- if (!pw_lck)
+ if (!pw_lck) {
+ errno = EINVAL;
return (-1);
+ }
/* Acquire the lock file. */
old_mode = umask(0);
fd = open(pw_lck, O_WRONLY|O_CREAT|O_EXCL, 0600);