From d86d6eb281ba99fca1bb39ad3dc05c5681dded5d Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 23 Jun 2016 21:07:36 +0100 Subject: Silence compiler warnings for expected and handled error conditions Silly compiler emitting warnings that just cause people to break code attempting to silence the compiler. Signed-off-by: Chris Wilson --- tests/kms_cursor_legacy.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests/kms_cursor_legacy.c') diff --git a/tests/kms_cursor_legacy.c b/tests/kms_cursor_legacy.c index 00890c95..d98de526 100644 --- a/tests/kms_cursor_legacy.c +++ b/tests/kms_cursor_legacy.c @@ -245,7 +245,9 @@ static void flip(struct data *data, drmModePageFlip(data->fd, crtc, fb_id, DRM_MODE_PAGE_FLIP_EVENT, NULL); - read(data->fd, buf, sizeof(buf)); + while (read(data->fd, buf, sizeof(buf)) < 0 && + (errno == EINTR || errno == EAGAIN)) + ; count++; } @@ -338,7 +340,7 @@ static void basic_flip(struct data *data) igt_assert_eq(get_vblank(data->fd, 0, 0), vblank_start); igt_set_timeout(1, "Stuck page flip"); - read(data->fd, &buf, sizeof(buf)); + igt_ignore_warn(read(data->fd, &buf, sizeof(buf))); igt_assert_eq(get_vblank(data->fd, 0, 0), vblank_start + 1); igt_reset_timeout(); -- cgit v1.2.3