Downgrade failed device acquisition to warning

master
Raheman Vaiya 4 years ago
parent 88c8475741
commit 1f0ff75e28
  1. 2
      Makefile
  2. 4
      src/evdev.c
  3. 10
      src/keyd.c

@ -7,7 +7,7 @@ SOCKET="/var/run/keyd.socket"
LOG_FILE="/var/log/keyd.log"
CONFIG_DIR="/etc/keyd"
VERSION=2.2.5-beta
VERSION=2.2.6-beta
GIT_HASH=$(shell git describe --no-match --always --abbrev=40 --dirty)
CFLAGS+=-DVERSION=\"$(VERSION)\" \

@ -114,12 +114,12 @@ uint32_t evdev_device_id(const char *devnode)
int fd = open(devnode, O_RDONLY);
if (fd < 0) {
perror("open");
exit(-1);
return 0;
}
if (ioctl(fd, EVIOCGID, &info) == -1) {
perror("ioctl");
exit(-1);
return 0;
}
close(fd);

@ -226,7 +226,7 @@ static int manage_keyboard(const char *devnode)
uint16_t vendor_id, product_id;
if (!(name = evdev_device_name(devnode))) {
fprintf(stderr, "Failed to obtain device info for %s, skipping..\n", devnode);
fprintf(stderr, "WARNING: Failed to obtain device info for %s, skipping..\n", devnode);
return -1;
}
@ -242,6 +242,11 @@ static int manage_keyboard(const char *devnode)
}
id = evdev_device_id(devnode);
if (!id) {
fprintf(stderr, "WARNING: Failed to obtain device id for %s (%s)\n", devnode, name);
return -1;
}
vendor_id = id >> 16;
product_id = id & 0xFFFF;
@ -253,8 +258,9 @@ static int manage_keyboard(const char *devnode)
}
if ((fd = open(devnode, O_RDONLY | O_NONBLOCK)) < 0) {
fprintf(stderr, "WARNING: Failed to open %s (%s)\n", devnode, name);
perror("open");
exit(1);
return -1;
}
/* Grab the keyboard. */

Loading…
Cancel
Save