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
}
}
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"