Update to latest clar

This commit is contained in:
Russell Belfer 2014-01-31 13:44:09 -08:00
parent f9500b4524
commit 7be88b4c4d

View File

@ -251,17 +251,22 @@ cl_fs_cleanup(void)
}
#else
#include <errno.h>
#include <string.h>
static int
shell_out(char * const argv[])
{
int status;
int status, piderr;
pid_t pid;
pid = fork();
if (pid < 0) {
fprintf(stderr,
"System error: `fork()` call failed.\n");
"System error: `fork()` call failed (%d) - %s\n",
errno, strerror(errno));
exit(-1);
}
@ -269,7 +274,10 @@ shell_out(char * const argv[])
execv(argv[0], argv);
}
waitpid(pid, &status, 0);
do {
piderr = waitpid(pid, &status, WUNTRACED);
} while (piderr < 0 && (errno == EAGAIN || errno == EINTR));
return WEXITSTATUS(status);
}