Report fork errors as this test is likely to hit the default
authoranton <anton@openbsd.org>
Wed, 12 Jul 2023 18:21:39 +0000 (18:21 +0000)
committeranton <anton@openbsd.org>
Wed, 12 Jul 2023 18:21:39 +0000 (18:21 +0000)
kern.maxproc limit.

regress/sys/net/pf_trans/dev-limit.c

index b4e1f88..5a0aa85 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dev-limit.c,v 1.2 2023/07/10 17:45:17 anton Exp $ */
+/*     $OpenBSD: dev-limit.c,v 1.3 2023/07/12 18:21:39 anton Exp $ */
 
 /*
  * Copyright (c) 2023 Alexandr Nedvedicky <sashan@openbsd.org>
@@ -118,7 +118,13 @@ main(int argc, char *const argv[])
 
        i = 0;
        while ((sigchild == 0) && (i < chld_count)) {
-               if ((pids[i++] = fork()) == 0)
+               pid_t pid;
+
+               pid = fork();
+               pids[i++] = pid;
+               if (pid == -1)
+                       warn("fork");
+               else if (pid == 0)
                        execl(argv[0], argv[0], "-t", sleep_arg, NULL);
        }
        chld_count = i;