Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/resolv Mark the dup of the resolv fd for close on e...



details:   https://anonhg.NetBSD.org/src/rev/c60b90a21f2d
branches:  trunk
changeset: 332322:c60b90a21f2d
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Sep 16 01:29:48 2014 +0000

description:
Mark the dup of the resolv fd for close on exec.

diffstat:

 lib/libc/resolv/res_init.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 5f1b650e4f9d -r c60b90a21f2d lib/libc/resolv/res_init.c
--- a/lib/libc/resolv/res_init.c        Mon Sep 15 23:41:16 2014 +0000
+++ b/lib/libc/resolv/res_init.c        Tue Sep 16 01:29:48 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: res_init.c,v 1.28 2014/01/08 22:58:50 christos Exp $   */
+/*     $NetBSD: res_init.c,v 1.29 2014/09/16 01:29:48 christos Exp $   */
 
 /*
  * Copyright (c) 1985, 1989, 1993
@@ -76,7 +76,7 @@
 static const char sccsid[] = "@(#)res_init.c   8.1 (Berkeley) 6/7/93";
 static const char rcsid[] = "Id: res_init.c,v 1.26 2008/12/11 09:59:00 marka Exp";
 #else
-__RCSID("$NetBSD: res_init.c,v 1.28 2014/01/08 22:58:50 christos Exp $");
+__RCSID("$NetBSD: res_init.c,v 1.29 2014/09/16 01:29:48 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -499,7 +499,7 @@
 #ifdef RESOLVSORT
            statp->nsort = nsort;
 #endif
-           statp->_u._ext.ext->resfd = dup(fileno(fp));
+           statp->_u._ext.ext->resfd = fcntl(fileno(fp), F_DUPFD_CLOEXEC);
            (void) fclose(fp);
            if (fstat(statp->_u._ext.ext->resfd, &st) != -1)
                    __res_conf_time = statp->_u._ext.ext->res_conf_time =



Home | Main Index | Thread Index | Old Index