NetBSD-Bugs archive

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

Re: bin/51846: [PATCH] tests/lib/libc/sys/t_socketpair: use closefrom(3) instead of fcntl(3, F_CLOSEM) for portability



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

From: "Ngie Cooper (yaneurabeya)" <yaneurabeya%gmail.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/51846: [PATCH] tests/lib/libc/sys/t_socketpair: use
 closefrom(3) instead of fcntl(3, F_CLOSEM) for portability
Date: Thu, 12 Jan 2017 21:25:53 -0800

 --Apple-Mail=_030A430F-93F2-4BED-83ED-EEB8A71C6C0C
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain;
 	charset=us-ascii
 
 Patch attached.
 -Ngie
 
 --Apple-Mail=_030A430F-93F2-4BED-83ED-EEB8A71C6C0C
 Content-Disposition: attachment;
 	filename=t_socketpair-use-closefrom-instead-of-fcntl-F_CLOSEM.patch
 Content-Type: application/octet-stream;
 	x-unix-mode=0644;
 	name="t_socketpair-use-closefrom-instead-of-fcntl-F_CLOSEM.patch"
 Content-Transfer-Encoding: 7bit
 
 Index: lib/libc/sys/t_socketpair.c
 ===================================================================
 RCS file: /cvsroot/src/tests/lib/libc/sys/t_socketpair.c,v
 retrieving revision 1.1
 diff -u -r1.1 t_socketpair.c
 --- lib/libc/sys/t_socketpair.c	5 Nov 2011 18:19:02 -0000	1.1
 +++ lib/libc/sys/t_socketpair.c	13 Jan 2017 05:24:45 -0000
 @@ -63,7 +63,7 @@
  	while ((i = open("/", O_RDONLY)) < 3)
  		ATF_REQUIRE(i != -1);
  
 -	ATF_REQUIRE(fcntl(3, F_CLOSEM) != -1);
 +	ATF_REQUIRE(closefrom(3) != -1);
  
  	ATF_REQUIRE(socketpair(AF_UNIX, SOCK_DGRAM | flags, 0, fd) == 0);
  
 
 --Apple-Mail=_030A430F-93F2-4BED-83ED-EEB8A71C6C0C--
 


Home | Main Index | Thread Index | Old Index