summaryrefslogtreecommitdiff
path: root/src/modules/module-mmkbd-evdev.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-04-13 04:43:11 +0200
committerLennart Poettering <lennart@poettering.net>2009-04-13 04:43:11 +0200
commit66d21849e6ca71f61997e83e754d390a4af5f550 (patch)
tree696e90778256d25f805da52250c7c1a80c96e866 /src/modules/module-mmkbd-evdev.c
parentf1d3dfb11873d03bd5c59aa304db3cb336711a8b (diff)
downloadpulseaudio-66d21849e6ca71f61997e83e754d390a4af5f550.tar.gz
mmkbd: get rid of support for ancient kernels
Diffstat (limited to 'src/modules/module-mmkbd-evdev.c')
-rw-r--r--src/modules/module-mmkbd-evdev.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/src/modules/module-mmkbd-evdev.c b/src/modules/module-mmkbd-evdev.c
index ccee6e1d4..c43cfdac7 100644
--- a/src/modules/module-mmkbd-evdev.c
+++ b/src/modules/module-mmkbd-evdev.c
@@ -52,17 +52,6 @@ PA_MODULE_USAGE("device=<evdev device> sink=<sink name>");
#define DEFAULT_DEVICE "/dev/input/event0"
-/*
- * This isn't defined in older kernel headers and there is no way of
- * detecting it.
- */
-struct _input_id {
- __u16 bustype;
- __u16 vendor;
- __u16 product;
- __u16 version;
-};
-
static const char* const valid_modargs[] = {
"device",
"sink",
@@ -169,7 +158,7 @@ int pa__init(pa_module*m) {
pa_modargs *ma = NULL;
struct userdata *u;
int version;
- struct _input_id input_id;
+ struct input_id input_id;
char name[256];
uint8_t evtype_bitmask[EV_MAX/8 + 1];
@@ -180,15 +169,15 @@ int pa__init(pa_module*m) {
goto fail;
}
- m->userdata = u = pa_xnew(struct userdata,1);
+ m->userdata = u = pa_xnew(struct userdata, 1);
u->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("failed to open evdev device: %s", pa_cstrerror(errno));
+ if ((u->fd = open(pa_modargs_get_value(ma, "device", DEFAULT_DEVICE), O_RDONLY|O_NOCTTY)) < 0) {
+ pa_log("Failed to open evdev device: %s", pa_cstrerror(errno));
goto fail;
}
@@ -208,7 +197,7 @@ int pa__init(pa_module*m) {
input_id.vendor, input_id.product, input_id.version, input_id.bustype);
memset(name, 0, sizeof(name));
- if(ioctl(u->fd, EVIOCGNAME(sizeof(name)), name) < 0) {
+ if (ioctl(u->fd, EVIOCGNAME(sizeof(name)), name) < 0) {
pa_log("EVIOCGNAME failed: %s", pa_cstrerror(errno));
goto fail;
}