projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
[libiwinfo] apply FD_CLOEXEC on internal ioctl and netlink sockets
[project/luci.git]
/
contrib
/
package
/
iwinfo
/
src
/
iwinfo_madwifi.c
diff --git
a/contrib/package/iwinfo/src/iwinfo_madwifi.c
b/contrib/package/iwinfo/src/iwinfo_madwifi.c
index
9b761ed
..
daecf5d
100644
(file)
--- a/
contrib/package/iwinfo/src/iwinfo_madwifi.c
+++ b/
contrib/package/iwinfo/src/iwinfo_madwifi.c
@@
-202,7
+202,10
@@
static int madwifi_ioctl(struct iwreq *wrq, const char *ifname, int cmd, void *d
{
/* prepare socket */
if( ioctl_socket == -1 )
+ {
ioctl_socket = socket(AF_INET, SOCK_DGRAM, 0);
+ fcntl(ioctl_socket, F_SETFD, fcntl(ioctl_socket, F_GETFD) | FD_CLOEXEC);
+ }
strncpy(wrq->ifr_name, ifname, IFNAMSIZ);