diff options
author | ngie <ngie@FreeBSD.org> | 2017-01-14 00:33:03 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2017-01-14 00:33:03 +0000 |
commit | 824e97617534c97fee33711bc0684f138aa14e28 (patch) | |
tree | a417fd8f7f9e03a4aded5a4954e2ddf15bf04dbe /contrib/netbsd-tests/lib/libc/sys/t_unlink.c | |
parent | ecf033e7f3d0dd153f2cddc17d96f4e065008c77 (diff) | |
download | FreeBSD-src-824e97617534c97fee33711bc0684f138aa14e28.zip FreeBSD-src-824e97617534c97fee33711bc0684f138aa14e28.tar.gz |
MFC r311236,r311919:
r311236:
unlink_fifo: don't leak the file descriptors opened with mkfifo and open
MFC fater: 3 days
CID: 978316, 978317
r311919:
Partially revert r311236
There's no sense in trying to close a file descriptor from the negative cases
with unlink_test; it's best to ignore these cases.
The mkfifo case does make sense to keep though.
Diffstat (limited to 'contrib/netbsd-tests/lib/libc/sys/t_unlink.c')
-rw-r--r-- | contrib/netbsd-tests/lib/libc/sys/t_unlink.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_unlink.c b/contrib/netbsd-tests/lib/libc/sys/t_unlink.c index 8d94668..b504bb0 100644 --- a/contrib/netbsd-tests/lib/libc/sys/t_unlink.c +++ b/contrib/netbsd-tests/lib/libc/sys/t_unlink.c @@ -111,8 +111,15 @@ ATF_TC_HEAD(unlink_fifo, tc) ATF_TC_BODY(unlink_fifo, tc) { +#ifdef __FreeBSD__ + int fd; + ATF_REQUIRE_MSG((fd = mkfifo(path, 0666)) == 0, + "mkfifo failed: %s", strerror(errno)); + (void)close(fd); +#else ATF_REQUIRE(mkfifo(path, 0666) == 0); +#endif ATF_REQUIRE(unlink(path) == 0); errno = 0; |