diff options
author | ngie <ngie@FreeBSD.org> | 2017-01-07 09:16:18 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2017-01-07 09:16:18 +0000 |
commit | 35c33432fc83877a787631a33a12b88f8fb30f8d (patch) | |
tree | bb88523937de0656fbeeb23e69ea1797498ee068 /contrib/netbsd-tests/lib/libc | |
parent | 0fdcf2529f6d1050510099835d540e28c3de138f (diff) | |
download | FreeBSD-src-35c33432fc83877a787631a33a12b88f8fb30f8d.zip FreeBSD-src-35c33432fc83877a787631a33a12b88f8fb30f8d.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')
-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); } |