svn commit: r312096 - stable/10/contrib/netbsd-tests/lib/libc/sys

Ngie Cooper ngie at FreeBSD.org
Sat Jan 14 00:33:05 UTC 2017


Author: ngie
Date: Sat Jan 14 00:33:03 2017
New Revision: 312096
URL: https://svnweb.freebsd.org/changeset/base/312096

Log:
  MFC r311236,r311919:
  
  r311236:
  
  unlink_fifo: don't leak the file descriptors opened with mkfifo and open
  
  MFC fater:	3 days
  CID:		978316, 978317
  
  r311919:
  
  Partially revert r311236
  
  There's no sense in trying to close a file descriptor from the negative cases
  with unlink_test; it's best to ignore these cases.
  
  The mkfifo case does make sense to keep though.

Modified:
  stable/10/contrib/netbsd-tests/lib/libc/sys/t_unlink.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/netbsd-tests/lib/libc/sys/t_unlink.c
==============================================================================
--- stable/10/contrib/netbsd-tests/lib/libc/sys/t_unlink.c	Sat Jan 14 00:29:55 2017	(r312095)
+++ stable/10/contrib/netbsd-tests/lib/libc/sys/t_unlink.c	Sat Jan 14 00:33:03 2017	(r312096)
@@ -111,8 +111,15 @@ ATF_TC_HEAD(unlink_fifo, tc)
 
 ATF_TC_BODY(unlink_fifo, tc)
 {
+#ifdef	__FreeBSD__
+	int fd;
 
+	ATF_REQUIRE_MSG((fd = mkfifo(path, 0666)) == 0,
+	    "mkfifo failed: %s", strerror(errno));
+	(void)close(fd);
+#else
 	ATF_REQUIRE(mkfifo(path, 0666) == 0);
+#endif
 	ATF_REQUIRE(unlink(path) == 0);
 
 	errno = 0;


More information about the svn-src-stable-10 mailing list