Module Name:    src
Committed By:   pooka
Date:           Tue Feb 15 16:10:41 UTC 2011

Modified Files:
        src/lib/librumpuser: rumpuser_sp.c

Log Message:
Cleanup server socket before sending back "ok" for halt.  Fixes
some occasionally-seen race conditions in tests which do server
restarts (e.g. the raidframe tests).


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/lib/librumpuser/rumpuser_sp.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/librumpuser/rumpuser_sp.c
diff -u src/lib/librumpuser/rumpuser_sp.c:1.41 src/lib/librumpuser/rumpuser_sp.c:1.42
--- src/lib/librumpuser/rumpuser_sp.c:1.41	Tue Feb 15 10:37:07 2011
+++ src/lib/librumpuser/rumpuser_sp.c	Tue Feb 15 16:10:41 2011
@@ -1,4 +1,4 @@
-/*      $NetBSD: rumpuser_sp.c,v 1.41 2011/02/15 10:37:07 pooka Exp $	*/
+/*      $NetBSD: rumpuser_sp.c,v 1.42 2011/02/15 16:10:41 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: rumpuser_sp.c,v 1.41 2011/02/15 10:37:07 pooka Exp $");
+__RCSID("$NetBSD: rumpuser_sp.c,v 1.42 2011/02/15 16:10:41 pooka Exp $");
 
 #include <sys/types.h>
 #include <sys/atomic.h>
@@ -1191,6 +1191,10 @@
 	struct spclient *spc = arg;
 	register_t retval[2] = {0, 0};
 
+	if (spclist[0].spc_fd) {
+		parsetab[cleanupidx].cleanup(cleanupsa);
+	}
+
 	/*
 	 * stuff response into the socket, since this process is just
 	 * about to exit
@@ -1199,7 +1203,6 @@
 		send_syscall_resp(spc, spc->spc_syscallreq, 0, retval);
 
 	if (spclist[0].spc_fd) {
-		parsetab[cleanupidx].cleanup(cleanupsa);
 		shutdown(spclist[0].spc_fd, SHUT_RDWR);
 		spfini = 1;
 	}

Reply via email to