summaryrefslogtreecommitdiff
path: root/openbsd-compat/bsd-closefrom.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2005-11-10 19:29:12 +1100
committerDarren Tucker <dtucker@zip.com.au>2005-11-10 19:29:12 +1100
commit30d6974124fd54c5bd9f101d9e31291fc9eda1b9 (patch)
tree1a659540ea531ac03bffdde09e6c2c76b8c592e7 /openbsd-compat/bsd-closefrom.c
parentfe80d7a0683d5e8e55a9cb057f9271f9a5b883c5 (diff)
- (dtucker) [openbsd-compat/sigact.c] Update from OpenBSD 1.3 -> 1.4.
Id and copyright sync only, there were no substantial changes we need.
Diffstat (limited to 'openbsd-compat/bsd-closefrom.c')
-rw-r--r--openbsd-compat/bsd-closefrom.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/openbsd-compat/bsd-closefrom.c b/openbsd-compat/bsd-closefrom.c
index 61a9fa39..5b7b94ae 100644
--- a/openbsd-compat/bsd-closefrom.c
+++ b/openbsd-compat/bsd-closefrom.c
@@ -46,7 +46,7 @@
# define OPEN_MAX 256
#endif
-RCSID("$Id: bsd-closefrom.c,v 1.1 2004/08/15 08:41:00 djm Exp $");
+RCSID("$Id: bsd-closefrom.c,v 1.2 2005/11/10 08:29:13 dtucker Exp $");
#ifndef lint
static const char sudorcsid[] = "$Sudo: closefrom.c,v 1.6 2004/06/01 20:51:56 millert Exp $";
@@ -67,7 +67,7 @@ closefrom(int lowfd)
/* Check for a /proc/$$/fd directory. */
len = snprintf(fdpath, sizeof(fdpath), "/proc/%ld/fd", (long)getpid());
- if (len != -1 && len <= sizeof(fdpath) && (dirp = opendir(fdpath))) {
+ if (len >= 0 && (u_int)len <= sizeof(fdpath) && (dirp = opendir(fdpath))) {
while ((dent = readdir(dirp)) != NULL) {
fd = strtol(dent->d_name, &endp, 10);
if (dent->d_name != endp && *endp == '\0' &&