summaryrefslogtreecommitdiff
path: root/regress/sys/net
diff options
context:
space:
mode:
authorAnton Lindqvist <anton@cvs.openbsd.org>2023-07-12 18:21:40 +0000
committerAnton Lindqvist <anton@cvs.openbsd.org>2023-07-12 18:21:40 +0000
commit453dc997df61de460d0958d22449ba88dc5d52c7 (patch)
tree2bd5003014dd723a8fb4b5ad0ff68bd5ad65934f /regress/sys/net
parentbb0679aea96fa7b07ef1fdb451a6c59c28533ce3 (diff)
Report fork errors as this test is likely to hit the default
kern.maxproc limit.
Diffstat (limited to 'regress/sys/net')
-rw-r--r--regress/sys/net/pf_trans/dev-limit.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/regress/sys/net/pf_trans/dev-limit.c b/regress/sys/net/pf_trans/dev-limit.c
index b4e1f88ff59..5a0aa85cd4e 100644
--- a/regress/sys/net/pf_trans/dev-limit.c
+++ b/regress/sys/net/pf_trans/dev-limit.c
@@ -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;