-/* $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>
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;