moreutils (0.39) UNRELEASED; urgency=low
* Cap sillyness. Closes: #570815
+ * parallel: Fix exit code handling when commands are specified after --
-- Joey Hess <joeyh@debian.org> Sun, 21 Feb 2010 13:16:10 -0500
}
else {
if (fork() == 0) {
- exit(system(arguments[0]));
+ int ret=system(arguments[0]);
+ if (WIFEXITED(ret)) {
+ exit(WEXITSTATUS(ret));
+ }
+ else {
+ exit(1);
+ }
}
}
return;
infop.si_pid = 0;
waitid(P_ALL, id_ignored, &infop, WEXITED | options);
- if (infop.si_pid == 0)
+ if (infop.si_pid == 0) {
return -1; /* Nothing to wait for */
- if (infop.si_code == CLD_EXITED)
+ }
+ if (infop.si_code == CLD_EXITED) {
return infop.si_status;
+ }
return 1;
}