summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorThomas Wood <thomas.wood@intel.com>2014-05-12 10:20:55 +0100
committerThomas Wood <thomas.wood@intel.com>2014-05-14 12:33:02 +0100
commitc03d58595e23d155aa470e60e6debaa0ee357a1b (patch)
tree41a63930ba2d43778f987ec146bba03206807f61 /lib
parentd8e5313a276c856fdd6f600e69e26f45e4c370c0 (diff)
lib: set a timeout when reading crc values
Signed-off-by: Thomas Wood <thomas.wood@intel.com> Acked-by: Damien Lespiau <damien.lespiau@intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/igt_debugfs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index 4fd2e5aa..0912f5bf 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -459,7 +459,10 @@ static bool read_one_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out)
ssize_t bytes_read;
char buf[pipe_crc->buffer_len];
+ igt_set_timeout(5);
bytes_read = read(pipe_crc->crc_fd, &buf, pipe_crc->line_len);
+ igt_set_timeout(0);
+
igt_assert_cmpint(bytes_read, ==, pipe_crc->line_len);
buf[bytes_read] = '\0';