[Pommed-commits] r379 - in trunk: . pommed
jblache at alioth.debian.org
jblache at alioth.debian.org
Sat Nov 17 09:50:54 UTC 2007
Author: jblache
Date: 2007-11-17 09:50:54 +0000 (Sat, 17 Nov 2007)
New Revision: 379
Modified:
trunk/ChangeLog
trunk/pommed/beep.c
Log:
add secondary locations for the uinput device node. Heads up & patch from Carmine 'earcar' Paolino.
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2007-11-16 21:50:10 UTC (rev 378)
+++ trunk/ChangeLog 2007-11-17 09:50:54 UTC (rev 379)
@@ -14,6 +14,8 @@
- pommed: add support for the external Apple USB keyboards, white
& alu. If you have such a keyboard with another USB ID, please
contact me. Patch from Carmine 'earcar' Paolino <earcar at gmail.com>.
+ - pommed: add secondary locations for the uinput device
+ node. Heads up & patch from Carmine 'earcar' Paolino.
version 1.10:
- pommed: add a beeper feature as a substitute to the missing PC
Modified: trunk/pommed/beep.c
===================================================================
--- trunk/pommed/beep.c 2007-11-16 21:50:10 UTC (rev 378)
+++ trunk/pommed/beep.c 2007-11-17 09:50:54 UTC (rev 379)
@@ -96,8 +96,15 @@
int
beep_open_device(void)
{
+ char *uinput_dev[3] =
+ {
+ "/dev/input/uinput",
+ "/dev/uinput",
+ "/dev/misc/uinput"
+ };
struct uinput_user_dev dv;
int fd;
+ int i;
int ret;
beep_info.fd = -1;
@@ -105,10 +112,17 @@
if (beep_cfg.enabled == 0)
return -1;
- fd = open("/dev/input/uinput", O_RDWR, 0);
+ for (i = 0; i < (sizeof(uinput_dev) / sizeof(uinput_dev[0])); i++)
+ {
+ fd = open(uinput_dev[i], O_RDWR, 0);
+
+ if (fd >= 0)
+ break;
+ }
+
if (fd < 0)
{
- logmsg(LOG_ERR, "beep: could not open /dev/input/uinput: %s", strerror(errno));
+ logmsg(LOG_ERR, "beep: could not open uinput: %s", strerror(errno));
logmsg(LOG_ERR, "beep: Do you have the uinput module loaded?");
return -1;
More information about the Pommed-commits
mailing list