Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] lib/igt_kms: Fix build warning in igt_display_drop_events
@ 2018-01-09 12:47 Tvrtko Ursulin
  2018-01-09 13:51 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tvrtko Ursulin @ 2018-01-09 12:47 UTC (permalink / raw)
  To: Intel-gfx

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Check read(2) return for robustness and to silence gcc.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
--
Compile tested only.
---
 lib/igt_kms.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index ec3b716791a2..c8f30d2c8a54 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -3155,10 +3155,11 @@ int igt_display_drop_events(igt_display_t *display)
 		struct drm_event ev;
 		char buf[128];
 
-		read(display->drm_fd, &ev, sizeof(ev));
+		igt_assert_eq(read(display->drm_fd, &ev, sizeof(ev)),
+			      sizeof(ev));
 		igt_info("Dropping event type %u length %u\n", ev.type, ev.length);
 		igt_assert(ev.length <= sizeof(buf));
-		read(display->drm_fd, buf, ev.length);
+		igt_assert_eq(read(display->drm_fd, buf, ev.length), ev.length);
 		ret++;
 	}
 
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-01-10 17:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-09 12:47 [PATCH i-g-t] lib/igt_kms: Fix build warning in igt_display_drop_events Tvrtko Ursulin
2018-01-09 13:51 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-01-09 15:59 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-01-10 17:46 ` [PATCH i-g-t] " Chris Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox