Module Name:    src
Committed By:   martin
Date:           Mon Apr  9 19:42:07 UTC 2012

Modified Files:
        src/sys/kern: kern_exec.c
        src/tests/lib/libc/gen/posix_spawn: t_fileactions.c

Log Message:
Fix asynchronous posix_spawn child exit status (and test for it).


To generate a diff of this commit:
cvs rdiff -u -r1.348 -r1.349 src/sys/kern/kern_exec.c
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/gen/posix_spawn/t_fileactions.c

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

Modified files:

Index: src/sys/kern/kern_exec.c
diff -u src/sys/kern/kern_exec.c:1.348 src/sys/kern/kern_exec.c:1.349
--- src/sys/kern/kern_exec.c:1.348	Sun Apr  8 11:27:44 2012
+++ src/sys/kern/kern_exec.c	Mon Apr  9 19:42:06 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exec.c,v 1.348 2012/04/08 11:27:44 martin Exp $	*/
+/*	$NetBSD: kern_exec.c,v 1.349 2012/04/09 19:42:06 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.348 2012/04/08 11:27:44 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.349 2012/04/09 19:42:06 martin Exp $");
 
 #include "opt_exec.h"
 #include "opt_ktrace.h"
@@ -2003,7 +2003,7 @@ spawn_return(void *arg)
 	 * A NetBSD specific workaround is POSIX_SPAWN_RETURNERROR as
 	 * flag bit in the attrp argument to posix_spawn(2), see above.
 	 */
-	exit1(l, W_EXITCODE(127, SIGABRT));
+	exit1(l, W_EXITCODE(127, 0));
 }
 
 void

Index: src/tests/lib/libc/gen/posix_spawn/t_fileactions.c
diff -u src/tests/lib/libc/gen/posix_spawn/t_fileactions.c:1.4 src/tests/lib/libc/gen/posix_spawn/t_fileactions.c:1.5
--- src/tests/lib/libc/gen/posix_spawn/t_fileactions.c:1.4	Sun Apr  8 11:27:46 2012
+++ src/tests/lib/libc/gen/posix_spawn/t_fileactions.c	Mon Apr  9 19:42:07 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_fileactions.c,v 1.4 2012/04/08 11:27:46 martin Exp $ */
+/* $NetBSD: t_fileactions.c,v 1.5 2012/04/09 19:42:07 martin Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -237,8 +237,7 @@ ATF_TC_BODY(t_spawn_open_nonexistent, tc
 		 * return exit code 127
 		 */
 		waitpid(pid, &status, 0);
-		ATF_REQUIRE(WEXITSTATUS(status) == 127);
-		
+		ATF_REQUIRE(WIFEXITED(status) && WEXITSTATUS(status) == 127);
 	} else {
 		/*
 		 * The error has been noticed early enough, no child has

Reply via email to