Module Name:    src
Committed By:   riastradh
Date:           Thu Mar 27 10:57:30 UTC 2025

Modified Files:
        src/tests/net/net: t_unix.c

Log Message:
t_unix: Make existing tests more reliable by exiting in child.

Returning into atf in the child is not helpful.

Preparation for adding a test for:

PR kern/59220: accept(2): null pointer deref


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/tests/net/net/t_unix.c

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

Modified files:

Index: src/tests/net/net/t_unix.c
diff -u src/tests/net/net/t_unix.c:1.26 src/tests/net/net/t_unix.c:1.27
--- src/tests/net/net/t_unix.c:1.26	Thu Mar 27 10:57:10 2025
+++ src/tests/net/net/t_unix.c	Thu Mar 27 10:57:30 2025
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_unix.c,v 1.26 2025/03/27 10:57:10 riastradh Exp $	*/
+/*	$NetBSD: t_unix.c,v 1.27 2025/03/27 10:57:30 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 #define _GNU_SOURCE
 #include <sys/cdefs.h>
 #ifdef __RCSID
-__RCSID("$Id: t_unix.c,v 1.26 2025/03/27 10:57:10 riastradh Exp $");
+__RCSID("$Id: t_unix.c,v 1.27 2025/03/27 10:57:30 riastradh Exp $");
 #else
 #define getprogname() argv[0]
 #endif
@@ -372,6 +372,8 @@ test(bool forkit, bool closeit, bool sta
 
 	free(sock_addr);
 	free(sun);
+	if (forkit && clntpid == getpid())
+		_exit(0);
 	return 0;
 fail:
 	if (srvrpid == getpid()) {
@@ -386,6 +388,8 @@ fail:
 	}
 	free(sock_addr);
 	free(sun);
+	if (forkit && clntpid == getpid())
+		_exit(0);
 	return -1;
 }
 

Reply via email to