Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jan 2011 19:33:57 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r217969 - head/sbin/hastd
Message-ID:  <201101271933.p0RJXvLU032386@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pjd
Date: Thu Jan 27 19:33:57 2011
New Revision: 217969
URL: http://svn.freebsd.org/changeset/base/217969

Log:
  Remember created control connection so on fork(2) we can close it in child.
  
  Found with:	procstat(1)
  MFC after:	1 week

Modified:
  head/sbin/hastd/control.c
  head/sbin/hastd/hast.h

Modified: head/sbin/hastd/control.c
==============================================================================
--- head/sbin/hastd/control.c	Thu Jan 27 19:32:53 2011	(r217968)
+++ head/sbin/hastd/control.c	Thu Jan 27 19:33:57 2011	(r217969)
@@ -278,6 +278,7 @@ control_handle(struct hastd_config *cfg)
 		return;
 	}
 
+	cfg->hc_controlin = conn;
 	nvin = nvout = NULL;
 	role = HAST_ROLE_UNDEF;
 
@@ -384,6 +385,7 @@ close:
 	if (nvout != NULL)
 		nv_free(nvout);
 	proto_close(conn);
+	cfg->hc_controlin = NULL;
 }
 
 /*

Modified: head/sbin/hastd/hast.h
==============================================================================
--- head/sbin/hastd/hast.h	Thu Jan 27 19:32:53 2011	(r217968)
+++ head/sbin/hastd/hast.h	Thu Jan 27 19:33:57 2011	(r217969)
@@ -101,6 +101,8 @@ struct hastd_config {
 	char	 hc_controladdr[HAST_ADDRSIZE];
 	/* Protocol-specific data. */
 	struct proto_conn *hc_controlconn;
+	/* Incoming control connection. */
+	struct proto_conn *hc_controlin;
 	/* Address to listen on. */
 	char	 hc_listenaddr[HAST_ADDRSIZE];
 	/* Protocol-specific data. */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101271933.p0RJXvLU032386>