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>
This commit is contained in:
Thomas Wood 2014-05-12 10:20:55 +01:00
parent d8e5313a27
commit c03d58595e

View File

@ -459,7 +459,10 @@ static bool read_one_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out)
ssize_t bytes_read; ssize_t bytes_read;
char buf[pipe_crc->buffer_len]; char buf[pipe_crc->buffer_len];
igt_set_timeout(5);
bytes_read = read(pipe_crc->crc_fd, &buf, pipe_crc->line_len); 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); igt_assert_cmpint(bytes_read, ==, pipe_crc->line_len);
buf[bytes_read] = '\0'; buf[bytes_read] = '\0';