mknodat_fd: close dfd after use to avoid leaking it

MFC after:	3 days
Reported by:	Coverity
CID:		978287
This commit is contained in:
Enji Cooper 2017-01-04 04:32:00 +00:00
parent f4cbf11049
commit 5d37d9cc25
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=311248

View File

@ -80,6 +80,9 @@ ATF_TC_BODY(mknodat_fd, tc)
ATF_REQUIRE((fd = mknodat(dfd, BASEFILE, mode, dev)) != -1);
ATF_REQUIRE(close(fd) == 0);
ATF_REQUIRE(access(FILE, F_OK) == 0);
#ifdef __FreeBSD__
(void)close(dfd);
#endif
}
ATF_TC(mknodat_fdcwd);