db, extract: handle waitpid returning EINTR
parent
6941aac4c6
commit
d821265865
|
@ -72,7 +72,7 @@ static int uvol_run(struct apk_ctx *ac, char *action, const char *volname, char
|
|||
apk_err(out, "%s: uvol exec error: %s", volname, apk_error_str(r));
|
||||
return r;
|
||||
}
|
||||
waitpid(pid, &status, 0);
|
||||
while (waitpid(pid, &status, 0) < 0 && errno == EINTR);
|
||||
if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
|
||||
apk_err(out, "%s: uvol exited with error %d", volname, WEXITSTATUS(status));
|
||||
return -APKE_UVOL;
|
||||
|
@ -109,7 +109,7 @@ static int uvol_extract(struct apk_ctx *ac, const char *volname, char *arg1, off
|
|||
return r;
|
||||
}
|
||||
|
||||
waitpid(pid, &status, 0);
|
||||
while (waitpid(pid, &status, 0) < 0 && errno == EINTR);
|
||||
if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
|
||||
apk_err(out, "%s: uvol exited with error %d", volname, WEXITSTATUS(status));
|
||||
return -APKE_UVOL;
|
||||
|
|
|
@ -1935,7 +1935,7 @@ int apk_db_run_script(struct apk_database *db, char *fn, char **argv)
|
|||
execve(fn, argv, environment);
|
||||
exit(127); /* should not get here */
|
||||
}
|
||||
waitpid(pid, &status, 0);
|
||||
while (waitpid(pid, &status, 0) < 0 && errno == EINTR);
|
||||
if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
|
||||
apk_err(out, "%s: script exited with error %d", basename(fn), WEXITSTATUS(status));
|
||||
return -1;
|
||||
|
|
Loading…
Reference in New Issue