svn commit: r311235 - head/contrib/netbsd-tests/lib/libc/gen

Ngie Cooper ngie at FreeBSD.org
Wed Jan 4 02:52:40 UTC 2017


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
 	}
 }
 


More information about the svn-src-all mailing list