[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] module-gsettings: Handle I/O hangup
PulseAudio Marge Bot (@pulseaudio-merge-bot)
gitlab at gitlab.freedesktop.org
Sun Jul 4 10:21:16 UTC 2021
PulseAudio Marge Bot pushed to branch master at PulseAudio / pulseaudio
Commits:
0555d4f5 by Igor V. Kovalenko at 2021-07-04T11:14:37+03: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>
- - - - -
2 changed files:
- src/modules/gsettings/module-gsettings.c
- src/modules/stdin-util.c
Changes:
=====================================
src/modules/gsettings/module-gsettings.c
=====================================
@@ -64,7 +64,7 @@ int pa__init(pa_module*m) {
u->io_event = m->core->mainloop->io_new(
m->core->mainloop,
u->fd,
- PA_IO_EVENT_INPUT,
+ PA_IO_EVENT_INPUT | PA_IO_EVENT_HANGUP | PA_IO_EVENT_ERROR,
io_event_cb,
u);
=====================================
src/modules/stdin-util.c
=====================================
@@ -267,13 +267,19 @@ void io_event_cb(
struct userdata *u = userdata;
- if (handle_event(u) < 0) {
+ 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 (u->io_event) {
- u->core->mainloop->io_free(u->io_event);
- u->io_event = NULL;
- }
+ if (handle_event(u) >= 0)
+ return;
- pa_module_unload_request(u->module, true);
+fail:
+ if (u->io_event) {
+ u->core->mainloop->io_free(u->io_event);
+ u->io_event = NULL;
}
+
+ pa_module_unload_request(u->module, true);
}
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/0555d4f5a5568333ae48216af6e7f1cd6a02fba8
--
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/0555d4f5a5568333ae48216af6e7f1cd6a02fba8
You're receiving this email because of your account on gitlab.freedesktop.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20210704/3fb2c982/attachment-0001.htm>
More information about the pulseaudio-commits
mailing list