diff options
author | Thomas Haller <thaller@redhat.com> | 2016-12-10 15:28:15 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-12-13 11:26:59 +0100 |
commit | 4bdee37771ae741f4f9548b52c1db53ddf080fe8 (patch) | |
tree | a531d21aa0fc18c62c50669bd5faa083af270566 /src/devices/tests | |
parent | e332c278245abc2c0d6e63ca9f36aa77961b15d5 (diff) |
all: use O_CLOEXEC for file descriptors
Diffstat (limited to 'src/devices/tests')
-rw-r--r-- | src/devices/tests/test-lldp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/devices/tests/test-lldp.c b/src/devices/tests/test-lldp.c index 5d28d461d..4d25f9a68 100644 --- a/src/devices/tests/test-lldp.c +++ b/src/devices/tests/test-lldp.c @@ -350,7 +350,7 @@ _test_recv_fixture_setup (TestRecvFixture *fixture, gconstpointer user_data) struct ifreq ifr = { }; int fd, s; - fd = open ("/dev/net/tun", O_RDWR); + fd = open ("/dev/net/tun", O_RDWR | O_CLOEXEC); g_assert (fd >= 0); ifr.ifr_flags = IFF_TAP | IFF_NO_PI; @@ -358,7 +358,7 @@ _test_recv_fixture_setup (TestRecvFixture *fixture, gconstpointer user_data) g_assert (ioctl (fd, TUNSETIFF, &ifr) >= 0); /* Bring the interface up */ - s = socket (AF_INET, SOCK_DGRAM, 0); + s = socket (AF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0); g_assert (s >= 0); ifr.ifr_flags |= IFF_UP; g_assert (ioctl (s, SIOCSIFFLAGS, &ifr) >= 0); |