Message ID | 20190908161950.7913-1-chris@chris-wilson.co.uk (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [i-g-t] tests/debugfs_test: Use O_NONBLOCK | expand |
diff --git a/tests/debugfs_test.c b/tests/debugfs_test.c index 6d1757c50..f8dd851c9 100644 --- a/tests/debugfs_test.c +++ b/tests/debugfs_test.c @@ -65,7 +65,7 @@ static void read_and_discard_sysfs_entries(int path_fd, int indent) igt_debug("%sReading file \"%s\"\n", tabs, dirent->d_name); igt_set_timeout(5, "reading sysfs entry"); - sub_fd = openat(path_fd, dirent->d_name, O_RDONLY); + sub_fd = openat(path_fd, dirent->d_name, O_RDONLY | O_NONBLOCK); if (sub_fd == -1) { igt_debug("%sCould not open file \"%s\" with error: %m\n", tabs, dirent->d_name);
Since we are just reading from each debugfs file, any that requires initial setup may not be fully setup or be left in a state that results in the file *expectedly* waiting. Use O_NONBLOCK to avoid waits on external events as we are just peeking for a trivial check that the files do not explode. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> --- tests/debugfs_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)