* 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.
}
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)