mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-17 06:59:56 -05:00
module-gsettings: Handle I/O hangup
When child `gsettings-helper` terminates prematurely, unconditionally reading from child pipe fails in a busy loop until child process is reaped. Fix this by terminating module upon PA_IO_EVENT_HANGUP or PA_IO_EVENT_ERROR. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/600>
This commit is contained in:
parent
7580ef31a1
commit
0555d4f5a5
2 changed files with 15 additions and 9 deletions
|
|
@ -267,13 +267,19 @@ void io_event_cb(
|
|||
|
||||
struct userdata *u = userdata;
|
||||
|
||||
if (handle_event(u) < 0) {
|
||||
|
||||
if (u->io_event) {
|
||||
u->core->mainloop->io_free(u->io_event);
|
||||
u->io_event = NULL;
|
||||
}
|
||||
|
||||
pa_module_unload_request(u->module, true);
|
||||
if (events & (PA_IO_EVENT_HANGUP|PA_IO_EVENT_ERROR)) {
|
||||
pa_log("Lost I/O connection in module \"%s\"", u->module->name);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (handle_event(u) >= 0)
|
||||
return;
|
||||
|
||||
fail:
|
||||
if (u->io_event) {
|
||||
u->core->mainloop->io_free(u->io_event);
|
||||
u->io_event = NULL;
|
||||
}
|
||||
|
||||
pa_module_unload_request(u->module, true);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue