NetBSD-Bugs archive

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

Re: bin/51809: [PATCH] tests/lib/libc/gen/t_ftok: fix file descriptor leak



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

From: "Ngie Cooper (yaneurabeya)" <yaneurabeya%gmail.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/51809: [PATCH] tests/lib/libc/gen/t_ftok: fix file descriptor
 leak
Date: Tue, 10 Jan 2017 01:30:30 -0800

 --Apple-Mail=_109201EA-C822-4790-860B-958254A29715
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain;
 	charset=us-ascii
 
 Patch attached.
 
 --Apple-Mail=_109201EA-C822-4790-860B-958254A29715
 Content-Disposition: attachment;
 	filename=t_ftok-dont-leak-fd-after-open.patch
 Content-Type: application/octet-stream;
 	x-unix-mode=0644;
 	name="t_ftok-dont-leak-fd-after-open.patch"
 Content-Transfer-Encoding: 7bit
 
 Index: t_ftok.c
 ===================================================================
 RCS file: /cvsroot/src/tests/lib/libc/gen/t_ftok.c,v
 retrieving revision 1.1
 diff -u -r1.1 t_ftok.c
 --- t_ftok.c	8 Nov 2011 05:47:00 -0000	1.1
 +++ t_ftok.c	10 Jan 2017 09:26:39 -0000
 @@ -68,6 +68,7 @@
  	fd = open(path, O_RDONLY | O_CREAT);
  
  	ATF_REQUIRE(fd >= 0);
 +	(void)close(fd);
  	ATF_REQUIRE(link(path, hlnk) == 0);
  	ATF_REQUIRE(symlink(path, slnk) == 0);
  
 
 --Apple-Mail=_109201EA-C822-4790-860B-958254A29715--
 


Home | Main Index | Thread Index | Old Index