From 4bdee37771ae741f4f9548b52c1db53ddf080fe8 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sat, 10 Dec 2016 15:28:15 +0100 Subject: all: use O_CLOEXEC for file descriptors --- src/devices/tests/test-lldp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/devices/tests') 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); -- cgit v1.2.3