hush: code shrink
function old new delta builtin_wait 347 328 -19 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
932302666b
commit
85378cded7
@ -9120,12 +9120,9 @@ static int FAST_FUNC builtin_wait(char **argv)
|
|||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
if (waitpid(pid, &status, 0) == pid) {
|
if (waitpid(pid, &status, 0) == pid) {
|
||||||
|
ret = WEXITSTATUS(status);
|
||||||
if (WIFSIGNALED(status))
|
if (WIFSIGNALED(status))
|
||||||
ret = 128 + WTERMSIG(status);
|
ret = 128 + WTERMSIG(status);
|
||||||
else if (WIFEXITED(status))
|
|
||||||
ret = WEXITSTATUS(status);
|
|
||||||
else /* wtf? */
|
|
||||||
ret = EXIT_FAILURE;
|
|
||||||
} else {
|
} else {
|
||||||
bb_perror_msg("wait %s", *argv);
|
bb_perror_msg("wait %s", *argv);
|
||||||
ret = 127;
|
ret = 127;
|
||||||
|
Loading…
Reference in New Issue
Block a user