summaryrefslogtreecommitdiff
path: root/tools/tap-test.c
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2011-10-23 14:16:23 +0200
committerMarcel Holtmann <marcel@holtmann.org>2011-10-25 13:34:06 +0200
commit4826f90b555f009972276be1fa945d81b435950a (patch)
tree2d62eda201ef154be4aeb869978685e9d99f1a24 /tools/tap-test.c
parentcb3e78500a2539a61d73ecb9708a2b06ea1f356d (diff)
downloadconnman-4826f90b555f009972276be1fa945d81b435950a.tar.gz
tools: Add O_CLOEXEC to open()
Make sure all file descriptor are closed.
Diffstat (limited to 'tools/tap-test.c')
-rw-r--r--tools/tap-test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/tap-test.c b/tools/tap-test.c
index c215945c..18fc00bc 100644
--- a/tools/tap-test.c
+++ b/tools/tap-test.c
@@ -80,7 +80,7 @@ static int create_tap(const char *ifname)
struct ifreq ifr;
int fd, val;
- fd = open("/dev/net/tun", O_RDWR);
+ fd = open("/dev/net/tun", O_RDWR | O_CLOEXEC);
if (fd < 0) {
perror("Failed to open TUN/TAP device");
return -1;