summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2010-01-16 13:53:52 +1100
committerDarren Tucker <dtucker@zip.com.au>2010-01-16 13:53:52 +1100
commit612e400c68e644054e476082cb757b0a157a564b (patch)
treec70e86e6aab2fea8c2cd10c230831198e5614dd8
parentdab129bef57139232133a870430a9284858909bf (diff)
- (dtucker) [openbsd-compat/pwcache.c] Shrink ifdef area to prevent unused
variable warnings.
-rw-r--r--ChangeLog2
-rw-r--r--openbsd-compat/pwcache.c8
2 files changed, 6 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 0b533798..29e555ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,8 @@
- markus@cvs.openbsd.org 2010/01/15 09:24:23
[sftp-common.c]
unused
+ - (dtucker) [openbsd-compat/pwcache.c] Shrink ifdef area to prevent unused
+ variable warnings.
20100115
- (dtucker) OpenBSD CVS Sync
diff --git a/openbsd-compat/pwcache.c b/openbsd-compat/pwcache.c
index fa60935d..5a8b7880 100644
--- a/openbsd-compat/pwcache.c
+++ b/openbsd-compat/pwcache.c
@@ -58,12 +58,12 @@ user_from_uid(uid_t uid, int nouser)
cp = c_uid + (uid & MASK);
if (cp->uid != uid || cp->name == NULL) {
-#ifdef HAVE_SETPASSENT
if (pwopen == 0) {
+#ifdef HAVE_SETPASSENT
setpassent(1);
+#endif
pwopen = 1;
}
-#endif
if ((pw = getpwuid(uid)) == NULL) {
if (nouser)
return (NULL);
@@ -93,12 +93,12 @@ group_from_gid(gid_t gid, int nogroup)
cp = c_gid + (gid & MASK);
if (cp->gid != gid || cp->name == NULL) {
-#ifdef HAVE_SETGROUPENT
if (gropen == 0) {
+#ifdef HAVE_SETGROUPENT
setgroupent(1);
+#endif
gropen = 1;
}
-#endif
if ((gr = getgrgid(gid)) == NULL) {
if (nogroup)
return (NULL);