NetBSD Problem Report #51846
From www@NetBSD.org Fri Jan 13 05:23:13 2017
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id CBFD87A26A
for <gnats-bugs@gnats.NetBSD.org>; Fri, 13 Jan 2017 05:23:13 +0000 (UTC)
Message-Id: <20170113052312.D9C367A2A1@mollari.NetBSD.org>
Date: Fri, 13 Jan 2017 05:23:12 +0000 (UTC)
From: yaneurabeya@gmail.com
Reply-To: yaneurabeya@gmail.com
To: gnats-bugs@NetBSD.org
Subject: [PATCH] tests/lib/libc/sys/t_socketpair: use closefrom(3) instead of fcntl(3, F_CLOSEM) for portability
X-Send-Pr-Version: www-1.0
>Number: 51846
>Category: bin
>Synopsis: [PATCH] tests/lib/libc/sys/t_socketpair: use closefrom(3) instead of fcntl(3, F_CLOSEM) for portability
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Jan 13 05:25:00 +0000 2017
>Closed-Date: Sun Jan 15 19:39:44 +0000 2017
>Last-Modified: Sun Jan 15 19:39:44 +0000 2017
>Originator: Ngie Cooper
>Release: 7.0.2
>Organization:
>Environment:
n/a
>Description:
Use "closefrom(3)" instead of "fcntl(3, F_CLOSEM)" for portability reasons (closefrom is available on FreeBSD).
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
From: "Ngie Cooper (yaneurabeya)" <yaneurabeya@gmail.com>
To: gnats-bugs@NetBSD.org
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--
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/51846 CVS commit: src/tests/lib/libc/sys
Date: Fri, 13 Jan 2017 15:04:52 -0500
Module Name: src
Committed By: christos
Date: Fri Jan 13 20:04:52 UTC 2017
Modified Files:
src/tests/lib/libc/sys: t_socketpair.c
Log Message:
PR/51846: Ngie Cooper: closefrom(3) instead of fcntl(3, F_CLOSEM)
for portability
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/sys/t_socketpair.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->closed
State-Changed-By: snj@NetBSD.org
State-Changed-When: Sun, 15 Jan 2017 19:39:44 +0000
State-Changed-Why:
christos committed it. thanks!
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.