diff options
Diffstat (limited to 'regress/sys/net')
-rw-r--r-- | regress/sys/net/pf_trans/dev-limit.c | 10 |
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; |