Module Name:    src
Committed By:   pooka
Date:           Thu Apr  3 17:11:35 UTC 2014

Modified Files:
        src/lib/librumpclient: rumpclient.c

Log Message:
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


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/lib/librumpclient/rumpclient.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/librumpclient/rumpclient.c
diff -u src/lib/librumpclient/rumpclient.c:1.60 src/lib/librumpclient/rumpclient.c:1.61
--- src/lib/librumpclient/rumpclient.c:1.60	Wed Apr  2 17:09:23 2014
+++ src/lib/librumpclient/rumpclient.c	Thu Apr  3 17:11:35 2014
@@ -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 @@ static struct spclient clispc = {
 	.spc_fd = -1,
 };
 
-static int holyfd;
+static int holyfd = -1;
 static sigset_t fullset;
 
 static int doconnect(void);
@@ -878,10 +878,9 @@ rumpclient_init(void)
 	if (init_done == (mypid = getpid()))
 		return 0;
 
-	/* kq does not traverse fork() */
 #ifdef USE_KQUEUE
-	if (init_done != 0)
-		holyfd = -1;
+	/* kq does not traverse fork() */
+	holyfd = -1;
 #endif
 	init_done = mypid;
 

Reply via email to