aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeebs <seebs@seebs.net>2011-05-25 12:47:26 -0500
committerSeebs <seebs@seebs.net>2011-05-25 12:47:26 -0500
commit24449163dcee2aa40387368779da25e6e29f13f0 (patch)
treecf9a27e8700a622f9154d22a98f5a807da5bb5b4
parent6660a3cc85430f1b90dc29a8a05b7230c90b4d15 (diff)
downloadpseudo-24449163dcee2aa40387368779da25e6e29f13f0.tar.gz
pseudo-24449163dcee2aa40387368779da25e6e29f13f0.tar.bz2
pseudo-24449163dcee2aa40387368779da25e6e29f13f0.zip
Make ulckpwdf() report failures
-rw-r--r--ChangeLog.txt3
-rw-r--r--ports/linux/guts/ulckpwdf.c3
-rw-r--r--pseudo_client.c5
-rw-r--r--pseudo_client.h2
4 files changed, 9 insertions, 4 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index e221d0a..f358e79 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,3 +1,6 @@
+2011-05-25:
+ * (seebs) fix for ulckpwdf()
+
2011-04-21:
* (seebs) don't use strerror in wrappers, because it can
lead to malloc deadlocks if part of setting up a malloc
diff --git a/ports/linux/guts/ulckpwdf.c b/ports/linux/guts/ulckpwdf.c
index bdb6f42..ed6a671 100644
--- a/ports/linux/guts/ulckpwdf.c
+++ b/ports/linux/guts/ulckpwdf.c
@@ -8,8 +8,7 @@
*/
/* lock is cleared automatically on close */
- pseudo_pwd_lck_close();
- rc = 0;
+ rc = pseudo_pwd_lck_close();
/* return rc;
* }
diff --git a/pseudo_client.c b/pseudo_client.c
index 2a204b1..1108658 100644
--- a/pseudo_client.c
+++ b/pseudo_client.c
@@ -377,7 +377,7 @@ pseudo_pwd_lck_open(void) {
return pseudo_pwd_lck_fd;
}
-void
+int
pseudo_pwd_lck_close(void) {
if (pseudo_pwd_lck_fd != -1) {
close(pseudo_pwd_lck_fd);
@@ -387,6 +387,9 @@ pseudo_pwd_lck_close(void) {
pseudo_pwd_lck_name = 0;
}
pseudo_pwd_lck_fd = -1;
+ return 0;
+ } else {
+ return -1;
}
}
diff --git a/pseudo_client.h b/pseudo_client.h
index 58ad875..587f8a3 100644
--- a/pseudo_client.h
+++ b/pseudo_client.h
@@ -48,7 +48,7 @@ extern FILE *pseudo_grp_open(void);
extern void pseudo_pwd_close(void);
extern void pseudo_grp_close(void);
extern int pseudo_pwd_lck_open(void);
-extern void pseudo_pwd_lck_close(void);
+extern int pseudo_pwd_lck_close(void);
extern FILE *pseudo_pwd;
extern FILE *pseudo_grp;