summaryrefslogtreecommitdiff
path: root/libc/pwd_grp
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2011-03-21 17:09:40 +0100
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2012-06-15 14:00:30 +0200
commit9c373ffdda5fd81d2c0bb9a1a1038a792bf47f23 (patch)
tree767517f04acddf14ee2430f4429226eea580d583 /libc/pwd_grp
parentda192bef87b60ecd616561dc28da71619acfbbe8 (diff)
lckpwdf.c: add back lost return
2 earlier (2006 and 2009) commits killed the proper return: -1 for failure, 0 on success Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libc/pwd_grp')
-rw-r--r--libc/pwd_grp/lckpwdf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libc/pwd_grp/lckpwdf.c b/libc/pwd_grp/lckpwdf.c
index adbc616a9..3c5449548 100644
--- a/libc/pwd_grp/lckpwdf.c
+++ b/libc/pwd_grp/lckpwdf.c
@@ -51,6 +51,7 @@ lckpwdf (void)
struct sigaction new_act; /* New signal action. */
struct flock fl; /* Information struct for locking. */
int result;
+ int rv = -1;
if (lock_fd != -1)
/* Still locked by own process. */
@@ -111,11 +112,13 @@ lckpwdf (void)
if (result < 0) {
close(lock_fd);
lock_fd = -1;
+ goto DONE;
}
+ rv = 0;
DONE:
__UCLIBC_MUTEX_UNLOCK(mylock);
- return 0; /* TODO: return result? */
+ return rv;
}