mknodat_fd: close dfd after use to avoid leaking it
MFC after: 3 days Reported by: Coverity CID: 978287
This commit is contained in:
parent
f4cbf11049
commit
5d37d9cc25
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=311248
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user