Skip to content

Commit 1f5041b

Browse files
Edward Liawwangli5665
authored andcommitted
input_common.h: Add retry loop for event device
Android has a delay between the entry in /proc/bus/input/devices and the path /dev/input/eventN becoming accessible. Add a retry loop to account for this. Signed-off-by: Edward Liaw <edliaw@google.com> Reviewed-by: Li Wang <liwang@redhat.com>
1 parent e7cafd7 commit 1f5041b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

testcases/kernel/input/input_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static inline int open_event_device(void)
2929
memset(path, 0, sizeof(path));
3030
snprintf(path, sizeof(path), "/dev/input/%s", device);
3131

32-
if (!access(path, F_OK)) {
32+
if (!TST_RETRY_FUNC(access(path, F_OK), TST_RETVAL_EQ0)) {
3333
tst_res(TINFO, "Found event device: %s", path);
3434
break;
3535
}

0 commit comments

Comments
 (0)