drm_hwcomposer: Fix EINTR handling in clock_nanosleep
clock_nanosleep return errno directly
instead of -1 with errno set
Signed-off-by: Keith Mok <keithmok@google.com>
[jstultz: Fixed minor style issues]
Signed-off-by: John Stultz <jstultz@google.com>
Change-Id: I779f2a8234b3dae46d64efee2210b7a2c5a92043
diff --git a/drm/VSyncWorker.cpp b/drm/VSyncWorker.cpp
index 8cb4d08..ed41189 100644
--- a/drm/VSyncWorker.cpp
+++ b/drm/VSyncWorker.cpp
@@ -92,7 +92,7 @@
vsync.tv_nsec = int(phased_timestamp - (vsync.tv_sec * kOneSecondNs));
do {
ret = clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &vsync, nullptr);
- } while (ret == -1 && errno == EINTR);
+ } while (ret == EINTR);
if (ret)
return ret;