diff options
author | Lennart Poettering <lennart@poettering.net> | 2006-07-14 22:42:01 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2006-07-14 22:42:01 +0000 |
commit | 860be2e70b33ff5eeb9130f80c4b1c096a2a8f27 (patch) | |
tree | a3193083ecdb5055a4536c22ea394c8243731571 /src/modules/module-mmkbd-evdev.c | |
parent | 350a253dc559956b63ced4e602b1040ccba66f98 (diff) |
try to use send(,,MSG_NOSIGNAL) instead of write() wherever possible (which
will allow us to drop the SIGPIPE check). Cache the results of the last
write()/send() to make sure that we do not issue more than necessary system
calls.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1083 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/modules/module-mmkbd-evdev.c')
-rw-r--r-- | src/modules/module-mmkbd-evdev.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/modules/module-mmkbd-evdev.c b/src/modules/module-mmkbd-evdev.c index ddbf16d2..c3d07396 100644 --- a/src/modules/module-mmkbd-evdev.c +++ b/src/modules/module-mmkbd-evdev.c @@ -70,7 +70,7 @@ static const char* const valid_modargs[] = { }; struct userdata { - int fd; + int fd, fd_type; pa_io_event *io; char *sink_name; pa_module *module; @@ -89,7 +89,7 @@ static void io_callback(pa_mainloop_api *io, PA_GCC_UNUSED pa_io_event *e, PA_GC if (events & PA_IO_EVENT_INPUT) { struct input_event ev; - if (pa_loop_read(u->fd, &ev, sizeof(ev)) <= 0) { + if (pa_loop_read(u->fd, &ev, sizeof(ev), &u->fd_type) <= 0) { pa_log(__FILE__": failed to read from event device: %s", pa_cstrerror(errno)); goto fail; } @@ -182,6 +182,7 @@ int pa__init(pa_core *c, pa_module*m) { u->io = NULL; u->sink_name = pa_xstrdup(pa_modargs_get_value(ma, "sink", NULL)); u->fd = -1; + u->fd_type = 0; if ((u->fd = open(pa_modargs_get_value(ma, "device", DEFAULT_DEVICE), O_RDONLY)) < 0) { pa_log(__FILE__": failed to open evdev device: %s", pa_cstrerror(errno)); |