Convert "fcntl(n, F_CLOSEM)" to "closefrom(n)"

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
ngie 2014-10-23 06:21:10 +00:00
parent d50799c7c0
commit 67e9e5ed09

View File

@ -63,7 +63,11 @@ run(int flags)
while ((i = open("/", O_RDONLY)) < 3)
ATF_REQUIRE(i != -1);
#ifdef __FreeBSD__
closefrom(3);
#else
ATF_REQUIRE(fcntl(3, F_CLOSEM) != -1);
#endif
ATF_REQUIRE(socketpair(AF_UNIX, SOCK_DGRAM | flags, 0, fd) == 0);