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 to close parent's server communi...



details:   https://anonhg.NetBSD.org/src/rev/53307548e28e
branches:  trunk
changeset: 761731:53307548e28e
user:      pooka <pooka%NetBSD.org@localhost>
date:      Sun Feb 06 15:41:37 2011 +0000

description:
Make sure to close parent's server communication socket after fork.

diffstat:

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

diffs (25 lines):

diff -r 694f39e0ad98 -r 53307548e28e lib/librumpclient/rumpclient.c
--- a/lib/librumpclient/rumpclient.c    Sun Feb 06 14:29:25 2011 +0000
+++ b/lib/librumpclient/rumpclient.c    Sun Feb 06 15:41:37 2011 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: rumpclient.c,v 1.22 2011/02/05 12:38:19 pooka Exp $   */
+/*      $NetBSD: rumpclient.c,v 1.23 2011/02/06 15:41:37 pooka Exp $   */
 
 /*
  * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -777,10 +777,13 @@
 rumpclient_fork_init(struct rumpclient_fork *rpf)
 {
        int error;
+       int osock;
 
+       osock = clispc.spc_fd;
        memset(&clispc, 0, sizeof(clispc));
-       clispc.spc_fd = -1;
-       kq = -1;
+       clispc.spc_fd = osock;
+
+       kq = -1; /* kqueue descriptor is not copied over fork() */
 
        if (doinit() == -1)
                return -1;



Home | Main Index | Thread Index | Old Index