projects
/
freeradius.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a143c10
)
fix typos
author
Alan T. DeKok
<aland@freeradius.org>
Mon, 26 Sep 2016 14:54:26 +0000
(10:54 -0400)
committer
Alan T. DeKok
<aland@freeradius.org>
Mon, 26 Sep 2016 14:54:26 +0000
(10:54 -0400)
src/lib/misc.c
patch
|
blob
|
history
diff --git
a/src/lib/misc.c
b/src/lib/misc.c
index
79bae9a
..
f81289b
100644
(file)
--- a/
src/lib/misc.c
+++ b/
src/lib/misc.c
@@
-1412,11
+1412,13
@@
int closefrom(int fd)
while ((dp = readdir(dir)) != NULL) {
my_fd = strtol(dp->d_name, &endp, 10);
if (my_fd <= 0) continue;
- if ((dp->d_name != endp) && !*endp) continue;
+
+ if ((endp > dp->d_name) && *endp) continue;
if (my_fd == dirfd(dir)) continue;
+
if ((my_fd >= fd) && (my_fd <= maxfd)) {
- (void) close((int) fd);
+ (void) close((int)
my_
fd);
}
}
(void) closedir(dir);