test
This commit is contained in:
parent
137fbb5098
commit
a74b159c02
1 changed files with 12 additions and 7 deletions
19
dev_evdev.c
19
dev_evdev.c
|
|
@ -97,13 +97,18 @@ int dev_evdev_open(
|
||||||
// open_sysfs
|
// open_sysfs
|
||||||
int skip = 0;
|
int skip = 0;
|
||||||
for (int o = 0; o < (sizeof(open_fds) / sizeof(open_fds[0])); ++o) {
|
for (int o = 0; o < (sizeof(open_fds) / sizeof(open_fds[0])); ++o) {
|
||||||
if ((open_fds[o] != -1) && (open_fds[o] == fd)) {
|
if (open_fds[o] != -1) {
|
||||||
close(fd);
|
if (open_fds[o] == fd) {
|
||||||
skip = 1;
|
// Device already opened
|
||||||
printf("Device %s already opened\n", path);
|
close(fd);
|
||||||
break;
|
skip = 1;
|
||||||
} else if (open_fds[o] == -1) {
|
printf("Device %s already opened\n", path);
|
||||||
open_sysfs_idx = o;
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (open_sysfs_idx == -1) {
|
||||||
|
open_sysfs_idx = o;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue