1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-02-10 17:31:56 +02:00

split: don’t worry about ECHILD

* src/split.c (closeout): There should be no need for a special
case for ECHILD, since we never wait for the same child twice.
Simplify with this in mind.
This commit is contained in:
Paul Eggert
2023-03-04 11:42:16 -08:00
parent 41615f0f8f
commit a110ce4ce3

View File

@@ -553,10 +553,10 @@ closeout (FILE *fp, int fd, pid_t pid, char const *name)
}
if (pid > 0)
{
int wstatus = 0;
if (waitpid (pid, &wstatus, 0) == -1 && errno != ECHILD)
int wstatus;
if (waitpid (pid, &wstatus, 0) < 0)
die (EXIT_FAILURE, errno, _("waiting for child process"));
if (WIFSIGNALED (wstatus))
else if (WIFSIGNALED (wstatus))
{
int sig = WTERMSIG (wstatus);
if (sig != SIGPIPE)