projects
/
freeradius.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b76bc73
)
added F_CLOSEM, which might work, too
author
Alan T. DeKok
<aland@freeradius.org>
Mon, 26 Sep 2016 12:08:04 +0000
(08:08 -0400)
committer
Alan T. DeKok
<aland@freeradius.org>
Mon, 26 Sep 2016 12:08:04 +0000
(08:08 -0400)
src/lib/misc.c
patch
|
blob
|
history
diff --git
a/src/lib/misc.c
b/src/lib/misc.c
index
be63066
..
de2b50f
100644
(file)
--- a/
src/lib/misc.c
+++ b/
src/lib/misc.c
@@
-1360,6
+1360,12
@@
int closefrom(int fd)
int i;
int maxfd = 256;
+#ifdef F_CLOSEM
+ if (fcntl(fd, F_CLOSEM) == 0) {
+ return 0;
+ }
+#endif
+
#ifdef _SC_OPEN_MAX
maxfd = sysconf(_SC_OPEN_MAX);
if (maxfd < 0) {
@@
-1371,8
+1377,6
@@
int closefrom(int fd)
/*
* FIXME: return EINTR?
- *
- * Use F_CLOSEM?
*/
for (i = fd; i < maxfd; i++) {
close(i);