diff options
author | ngie <ngie@FreeBSD.org> | 2017-01-07 09:16:22 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2017-01-07 09:16:22 +0000 |
commit | 5dba8e8dc119241ee8d6222279c0da2ce10f9efe (patch) | |
tree | 5f44476533b40e1de334e07e309c6be19783e59c /contrib/netbsd-tests/lib/libc/sys/t_revoke.c | |
parent | d05961ee9f1302e7c7e014a11611589b1060c20f (diff) | |
download | FreeBSD-src-5dba8e8dc119241ee8d6222279c0da2ce10f9efe.zip FreeBSD-src-5dba8e8dc119241ee8d6222279c0da2ce10f9efe.tar.gz |
MFC r311272:
revoke_perm: don't leak fd at the end of the test; close it
This code is unused on FreeBSD, but it mutes a valid Coverity warning
which would be true on NetBSD
CID: 978311
Diffstat (limited to 'contrib/netbsd-tests/lib/libc/sys/t_revoke.c')
-rw-r--r-- | contrib/netbsd-tests/lib/libc/sys/t_revoke.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_revoke.c b/contrib/netbsd-tests/lib/libc/sys/t_revoke.c index 926d2740..8e4c2a3 100644 --- a/contrib/netbsd-tests/lib/libc/sys/t_revoke.c +++ b/contrib/netbsd-tests/lib/libc/sys/t_revoke.c @@ -176,6 +176,9 @@ ATF_TC_BODY(revoke_perm, tc) if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS) atf_tc_fail("revoke(2) did not obey permissions"); +#ifdef __FreeBSD__ + (void)close(fd); +#endif ATF_REQUIRE(unlink(path) == 0); } |