]> andersk Git - openssh.git/blobdiff - openbsd-compat/bsd-closefrom.c
- jmc@cvs.openbsd.org 2006/07/18 07:56:28
[openssh.git] / openbsd-compat / bsd-closefrom.c
index 62e2be09b8877da4709a028352d95583d2222f6c..7509d2835e7e47a7b62c3288e0c012ee82040d6b 100644 (file)
@@ -46,8 +46,6 @@
 # define OPEN_MAX      256
 #endif
 
-RCSID("$Id$");
-
 #ifndef lint
 static const char sudorcsid[] = "$Sudo: closefrom.c,v 1.6 2004/06/01 20:51:56 millert Exp $";
 #endif /* lint */
@@ -67,7 +65,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' &&
This page took 0.034921 seconds and 4 git commands to generate.