diff options
author | ngie <ngie@FreeBSD.org> | 2017-01-07 09:27:46 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2017-01-07 09:27:46 +0000 |
commit | 06d25691ba0e6a849f0c30e87ca3df000492924c (patch) | |
tree | 36b1749a97363bfa43a6bc94ff1ee1d14ee37bb8 /contrib/netbsd-tests/lib/libc | |
parent | 4a00969e95b4a28f4a87e0deab438865dbcb4c2e (diff) | |
download | FreeBSD-src-06d25691ba0e6a849f0c30e87ca3df000492924c.zip FreeBSD-src-06d25691ba0e6a849f0c30e87ca3df000492924c.tar.gz |
MFC r311228:
ftok_link: don't leak fd
CID: 978291
Diffstat (limited to 'contrib/netbsd-tests/lib/libc')
-rw-r--r-- | contrib/netbsd-tests/lib/libc/gen/t_ftok.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_ftok.c b/contrib/netbsd-tests/lib/libc/gen/t_ftok.c index 100bd1b..718d310 100644 --- a/contrib/netbsd-tests/lib/libc/gen/t_ftok.c +++ b/contrib/netbsd-tests/lib/libc/gen/t_ftok.c @@ -68,6 +68,9 @@ ATF_TC_BODY(ftok_link, tc) fd = open(path, O_RDONLY | O_CREAT); ATF_REQUIRE(fd >= 0); +#ifdef __FreeBSD__ + (void)close(fd); +#endif ATF_REQUIRE(link(path, hlnk) == 0); ATF_REQUIRE(symlink(path, slnk) == 0); |