NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/51805: Fix file descriptor leaks in tests/lib/libc/c063/...



The following reply was made to PR bin/51805; it has been noted by GNATS.

From: "Ngie Cooper (yaneurabeya)" <yaneurabeya%gmail.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/51805: Fix file descriptor leaks in tests/lib/libc/c063/...
Date: Tue, 10 Jan 2017 00:45:55 -0800

 --Apple-Mail=_D402DE51-F1C3-4A32-AE08-E5546E7E10B7
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain;
 	charset=us-ascii
 
 Patch attached.
 
 --Apple-Mail=_D402DE51-F1C3-4A32-AE08-E5546E7E10B7
 Content-Disposition: attachment;
 	filename=dont-leak-fd-when-done.patch
 Content-Type: application/octet-stream;
 	x-unix-mode=0644;
 	name="dont-leak-fd-when-done.patch"
 Content-Transfer-Encoding: 7bit
 
 Index: t_mkfifoat.c
 ===================================================================
 RCS file: /cvsroot/src/tests/lib/libc/c063/t_mkfifoat.c,v
 retrieving revision 1.2
 diff -u -r1.2 t_mkfifoat.c
 --- t_mkfifoat.c	17 Mar 2013 04:46:06 -0000	1.2
 +++ t_mkfifoat.c	10 Jan 2017 08:29:21 -0000
 @@ -63,6 +63,7 @@
  	ATF_REQUIRE((fd = mkfifoat(dfd, BASEFIFO, mode)) != -1);
  	ATF_REQUIRE(close(fd) == 0);
  	ATF_REQUIRE(access(FIFO, F_OK) == 0);
 +	(void)close(dfd);
  }
  
  ATF_TC(mkfifoat_fdcwd);
 Index: t_mknodat.c
 ===================================================================
 RCS file: /cvsroot/src/tests/lib/libc/c063/t_mknodat.c,v
 retrieving revision 1.3
 diff -u -r1.3 t_mknodat.c
 --- t_mknodat.c	17 Mar 2013 04:46:06 -0000	1.3
 +++ t_mknodat.c	10 Jan 2017 08:29:21 -0000
 @@ -80,6 +80,7 @@
  	ATF_REQUIRE((fd = mknodat(dfd, BASEFILE, mode, dev)) != -1);
  	ATF_REQUIRE(close(fd) == 0);
  	ATF_REQUIRE(access(FILE, F_OK) == 0);
 +	(void)close(dfd);
  }
  
  ATF_TC(mknodat_fdcwd);
 Index: t_fexecve.c
 ===================================================================
 RCS file: /cvsroot/src/tests/lib/libc/c063/t_fexecve.c,v
 retrieving revision 1.2
 diff -u -r1.2 t_fexecve.c
 --- t_fexecve.c	17 Mar 2013 04:35:59 -0000	1.2
 +++ t_fexecve.c	10 Jan 2017 08:29:21 -0000
 @@ -70,6 +70,7 @@
  				error = 76;
  			else
  				error = EXIT_FAILURE;
 +			(void)close(fd);
  			err(error, "fexecve");
  		}
  	}
 
 --Apple-Mail=_D402DE51-F1C3-4A32-AE08-E5546E7E10B7--
 


Home | Main Index | Thread Index | Old Index