NetBSD-Bugs archive

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

Re: bin/51813: [PATCH] tests/lib/libc/gen/t_ttyname.c: don't leak fd in :ttyname_err



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

From: "Ngie Cooper (yaneurabeya)" <yaneurabeya%gmail.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/51813: [PATCH] tests/lib/libc/gen/t_ttyname.c: don't leak fd
 in :ttyname_err
Date: Tue, 10 Jan 2017 01:51:50 -0800

 --Apple-Mail=_2A392ED0-3788-4BC3-85C8-CE67E59AFFC6
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain;
 	charset=us-ascii
 
 Patch attached.
 
 --Apple-Mail=_2A392ED0-3788-4BC3-85C8-CE67E59AFFC6
 Content-Disposition: attachment;
 	filename=t_ttyname-dont-leak-fd.patch
 Content-Type: application/octet-stream;
 	x-unix-mode=0644;
 	name="t_ttyname-dont-leak-fd.patch"
 Content-Transfer-Encoding: 7bit
 
 Index: t_ttyname.c
 ===================================================================
 RCS file: /cvsroot/src/tests/lib/libc/gen/t_ttyname.c,v
 retrieving revision 1.3
 diff -p -u -r1.3 t_ttyname.c
 --- t_ttyname.c	1 May 2011 18:14:01 -0000	1.3
 +++ t_ttyname.c	10 Jan 2017 09:46:09 -0000
 @@ -78,6 +78,7 @@ ATF_TC_BODY(ttyname_err, tc)
  
  		ATF_REQUIRE(ttyname(fd) == NULL);
  		ATF_REQUIRE(errno == ENOTTY);
 +		(void)close(fd);
  	}
  }
  
 
 --Apple-Mail=_2A392ED0-3788-4BC3-85C8-CE67E59AFFC6--
 


Home | Main Index | Thread Index | Old Index