Source-Changes-HG archive

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

[src/trunk]: src/lib/librumpclient Make sure holyfd is -1 when rumpclient_ini...



details:   https://anonhg.NetBSD.org/src/rev/6352a025bd11
branches:  trunk
changeset: 328449:6352a025bd11
user:      pooka <pooka%NetBSD.org@localhost>
date:      Thu Apr 03 17:11:35 2014 +0000

description:
Make sure holyfd is -1 when rumpclient_init() is called for
the first time after fork to prevent fd 0 from being closed.

should fix test failures, thanks to martin for the prod

diffstat:

 lib/librumpclient/rumpclient.c |  11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diffs (40 lines):

diff -r 4ab365712975 -r 6352a025bd11 lib/librumpclient/rumpclient.c
--- a/lib/librumpclient/rumpclient.c    Thu Apr 03 17:11:10 2014 +0000
+++ b/lib/librumpclient/rumpclient.c    Thu Apr 03 17:11:35 2014 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: rumpclient.c,v 1.60 2014/04/02 17:09:23 justin Exp $  */
+/*      $NetBSD: rumpclient.c,v 1.61 2014/04/03 17:11:35 pooka Exp $   */
 
 /*
  * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -50,7 +50,7 @@
 #define USE_SIGNALFD
 #endif
 
-__RCSID("$NetBSD: rumpclient.c,v 1.60 2014/04/02 17:09:23 justin Exp $");
+__RCSID("$NetBSD: rumpclient.c,v 1.61 2014/04/03 17:11:35 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/mman.h>
@@ -121,7 +121,7 @@
        .spc_fd = -1,
 };
 
-static int holyfd;
+static int holyfd = -1;
 static sigset_t fullset;
 
 static int doconnect(void);
@@ -878,10 +878,9 @@
        if (init_done == (mypid = getpid()))
                return 0;
 
+#ifdef USE_KQUEUE
        /* kq does not traverse fork() */
-#ifdef USE_KQUEUE
-       if (init_done != 0)
-               holyfd = -1;
+       holyfd = -1;
 #endif
        init_done = mypid;
 



Home | Main Index | Thread Index | Old Index