Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Jan 2017 02:52:39 +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: r311235 - head/contrib/netbsd-tests/lib/libc/gen
Message-ID:  <201701040252.v042qdDM043068@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Wed Jan  4 02:52:39 2017
New Revision: 311235
URL: https://svnweb.freebsd.org/changeset/base/311235

Log:
  ttyname_err: close fd if it was opened successfully
  
  MFC after:	3 days
  Reported by:	Coverity
  CID:		978292

Modified:
  head/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c

Modified: head/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c
==============================================================================
--- head/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c	Wed Jan  4 02:51:39 2017	(r311234)
+++ head/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c	Wed Jan  4 02:52:39 2017	(r311235)
@@ -78,6 +78,9 @@ ATF_TC_BODY(ttyname_err, tc)
 
 		ATF_REQUIRE(ttyname(fd) == NULL);
 		ATF_REQUIRE(errno == ENOTTY);
+#ifdef	__FreeBSD__
+		(void)close(fd);
+#endif
 	}
 }
 



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