mkfifoat_fd: close dfd after use to avoid leaking it

MFC after:	3 days
Reported by:	Coverity
CID:		978286
This commit is contained in:
Enji Cooper 2017-01-04 04:29:53 +00:00
parent 5641f109c1
commit f4cbf11049
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=311247

View File

@ -63,6 +63,9 @@ ATF_TC_BODY(mkfifoat_fd, tc)
ATF_REQUIRE((fd = mkfifoat(dfd, BASEFIFO, mode)) != -1);
ATF_REQUIRE(close(fd) == 0);
ATF_REQUIRE(access(FIFO, F_OK) == 0);
#ifdef __FreeBSD__
(void)close(dfd);
#endif
}
ATF_TC(mkfifoat_fdcwd);