Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Jan 2017 08:59:06 +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: r311272 - head/contrib/netbsd-tests/lib/libc/sys
Message-ID:  <201701040859.v048x6S2090914@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Wed Jan  4 08:59:06 2017
New Revision: 311272
URL: https://svnweb.freebsd.org/changeset/base/311272

Log:
  revoke_perm: don't leak fd at the end of the test; close it
  
  This code is unused on FreeBSD, but it mutes a valid Coverity warning
  which would be true on NetBSD
  
  MFC after:	3 days
  Reported by:	Coverity
  CID:		978311

Modified:
  head/contrib/netbsd-tests/lib/libc/sys/t_revoke.c

Modified: head/contrib/netbsd-tests/lib/libc/sys/t_revoke.c
==============================================================================
--- head/contrib/netbsd-tests/lib/libc/sys/t_revoke.c	Wed Jan  4 08:49:07 2017	(r311271)
+++ head/contrib/netbsd-tests/lib/libc/sys/t_revoke.c	Wed Jan  4 08:59:06 2017	(r311272)
@@ -176,6 +176,9 @@ ATF_TC_BODY(revoke_perm, tc)
 	if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
 		atf_tc_fail("revoke(2) did not obey permissions");
 
+#ifdef	__FreeBSD__
+	(void)close(fd);
+#endif
 	ATF_REQUIRE(unlink(path) == 0);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701040859.v048x6S2090914>