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