[pulseaudio-commits] src/modules
David Henningsson
diwic at kemper.freedesktop.org
Fri Oct 3 05:28:04 PDT 2014
src/modules/module-mmkbd-evdev.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 8bfd38d6cac876f860e5dbf663b3b6db53e6423c
Author: David Henningsson <david.henningsson at canonical.com>
Date: Fri Sep 12 10:01:24 2014 +0200
module-mmkbd-evdev: Don't crash on failure to close fd
If the keyboard is unplugged, it looks like the kernel is reporting
back -ENODEV when trying to close the fd. This is probably a kernel
error, but still, it's better to complain than to crash.
Buglink: https://bugs.freedesktop.org/show_bug.cgi?id=80867
Reported-by: Stelios Bounanos
Signed-off-by: David Henningsson <david.henningsson at canonical.com>
diff --git a/src/modules/module-mmkbd-evdev.c b/src/modules/module-mmkbd-evdev.c
index 9ab7eb9..0b04f0f 100644
--- a/src/modules/module-mmkbd-evdev.c
+++ b/src/modules/module-mmkbd-evdev.c
@@ -256,8 +256,11 @@ void pa__done(pa_module*m) {
if (u->io)
m->core->mainloop->io_free(u->io);
- if (u->fd >= 0)
- pa_assert_se(pa_close(u->fd) == 0);
+ if (u->fd >= 0) {
+ int r = pa_close(u->fd);
+ if (r < 0) /* https://bugs.freedesktop.org/show_bug.cgi?id=80867 */
+ pa_log("Closing fd failed: %s", pa_cstrerror(errno));
+ }
pa_xfree(u->sink_name);
pa_xfree(u);
More information about the pulseaudio-commits
mailing list