Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Jan 2017 00:33:07 +0000 (UTC)
From:      Ngie Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r312097 - stable/11/contrib/netbsd-tests/lib/libc/sys
Message-ID:  <201701140033.v0E0X714056370@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Sat Jan 14 00:33:07 2017
New Revision: 312097
URL: https://svnweb.freebsd.org/changeset/base/312097

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/11/contrib/netbsd-tests/lib/libc/sys/t_unlink.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/netbsd-tests/lib/libc/sys/t_unlink.c
==============================================================================
--- stable/11/contrib/netbsd-tests/lib/libc/sys/t_unlink.c	Sat Jan 14 00:33:03 2017	(r312096)
+++ stable/11/contrib/netbsd-tests/lib/libc/sys/t_unlink.c	Sat Jan 14 00:33:07 2017	(r312097)
@@ -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;



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