From 4c75a3c1c1a141259ac481058647142f0ff729b2 Mon Sep 17 00:00:00 2001 From: anton Date: Wed, 12 Jul 2023 18:21:39 +0000 Subject: [PATCH] Report fork errors as this test is likely to hit the default kern.maxproc limit. --- regress/sys/net/pf_trans/dev-limit.c | 10 ++++++++-- 1 file 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 @@ -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; -- 2.20.1