Date: Wed, 4 Jan 2017 04:32:00 +0000 (UTC) From: Ngie Cooper <ngie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311248 - head/contrib/netbsd-tests/lib/libc/c063 Message-ID: <201701040432.v044W0C9083578@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ngie Date: Wed Jan 4 04:32:00 2017 New Revision: 311248 URL: https://svnweb.freebsd.org/changeset/base/311248 Log: mknodat_fd: close dfd after use to avoid leaking it MFC after: 3 days Reported by: Coverity CID: 978287 Modified: head/contrib/netbsd-tests/lib/libc/c063/t_mknodat.c Modified: head/contrib/netbsd-tests/lib/libc/c063/t_mknodat.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/c063/t_mknodat.c Wed Jan 4 04:29:53 2017 (r311247) +++ head/contrib/netbsd-tests/lib/libc/c063/t_mknodat.c Wed Jan 4 04:32:00 2017 (r311248) @@ -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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701040432.v044W0C9083578>