From 6922d5d01b03b0f584a411803d2da45b07f5af01 Mon Sep 17 00:00:00 2001 From: N-R-K Date: Thu, 28 Apr 2022 03:12:15 +0000 Subject: replace select() with poll() (#270) usage of select (3) in modern programs is typically discouraged. this simply replaces the select call with poll (3) instead. and since poll conveniently ignores negative fds, this also reduces needs for some special casing. this also handles error if they occur, while old implementation didn't. other than the error handling, no change in functionality should occur. --- nsxiv.h | 1 + 1 file changed, 1 insertion(+) (limited to 'nsxiv.h') diff --git a/nsxiv.h b/nsxiv.h index 4350864..67c2185 100644 --- a/nsxiv.h +++ b/nsxiv.h @@ -44,6 +44,7 @@ #define TV_DIFF(t1,t2) (((t1)->tv_sec - (t2)->tv_sec ) * 1000 + \ ((t1)->tv_usec - (t2)->tv_usec) / 1000) +#define TV_TO_MS(tv) (((tv)->tv_sec * 1000) + ((tv)->tv_usec / 1000)) #define TV_SET_MSEC(tv,t) { \ (tv)->tv_sec = (t) / 1000; \ -- cgit v1.2.3-54-g00ecf