client: if a child we created was already reaped, assume that it was successful

This commit is contained in:
Lennart Poettering 2009-07-25 01:29:36 +02:00
parent 59659e1db6
commit 6ce7d208f0

View file

@ -743,9 +743,16 @@ static int context_autospawn(pa_context *c) {
} while (r < 0 && errno == EINTR); } while (r < 0 && errno == EINTR);
if (r < 0) { if (r < 0) {
if (errno != ESRCH) {
pa_log(_("waitpid(): %s"), pa_cstrerror(errno)); pa_log(_("waitpid(): %s"), pa_cstrerror(errno));
pa_context_fail(c, PA_ERR_INTERNAL); pa_context_fail(c, PA_ERR_INTERNAL);
goto fail; goto fail;
}
/* hmm, something already reaped our child, so we assume
* startup worked, even if we cannot know */
} else if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) { } else if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
pa_context_fail(c, PA_ERR_CONNECTIONREFUSED); pa_context_fail(c, PA_ERR_CONNECTIONREFUSED);
goto fail; goto fail;