more debug

This commit is contained in:
Denis 2023-12-08 00:20:39 +01:00
parent e55798087b
commit 137fbb5098
No known key found for this signature in database
GPG key ID: DD9B63F805CF5C03

View file

@ -89,7 +89,7 @@ int dev_evdev_open(
// try to open the device, if it cannot be opened to go the next // try to open the device, if it cannot be opened to go the next
int fd = open(path, O_RDWR); int fd = open(path, O_RDWR);
if (fd < 0) { if (fd < 0) {
//fprintf(stderr, "Cannot open %s, device skipped.\n", sysfs_entry); fprintf(stderr, "Cannot open %s, device skipped.\n", path);
continue; continue;
} }
@ -100,6 +100,7 @@ int dev_evdev_open(
if ((open_fds[o] != -1) && (open_fds[o] == fd)) { if ((open_fds[o] != -1) && (open_fds[o] == fd)) {
close(fd); close(fd);
skip = 1; skip = 1;
printf("Device %s already opened\n", path);
break; break;
} else if (open_fds[o] == -1) { } else if (open_fds[o] == -1) {
open_sysfs_idx = o; open_sysfs_idx = o;
@ -107,6 +108,7 @@ int dev_evdev_open(
} }
if ((skip) || (open_sysfs_idx == -1)) { if ((skip) || (open_sysfs_idx == -1)) {
printf("skip=%d open_sysfs_idx=%d\n", skip, open_sysfs_idx);
continue; continue;
} else { } else {
open_fds[open_sysfs_idx] = fd; open_fds[open_sysfs_idx] = fd;