aboutsummaryrefslogtreecommitdiff
path: root/nsxiv.h
diff options
context:
space:
mode:
authorN-R-K <nrk@disroot.org>2022-04-28 03:12:15 +0000
committerGitHub <noreply@github.com>2022-04-28 03:12:15 +0000
commit6922d5d01b03b0f584a411803d2da45b07f5af01 (patch)
treea4977ced8afe9c376030d09f1cb7eba2e70bb241 /nsxiv.h
parent5bb1df4af3a221ad65a95cf5f86b554dab2917b1 (diff)
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.
Diffstat (limited to 'nsxiv.h')
-rw-r--r--nsxiv.h1
1 files changed, 1 insertions, 0 deletions
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; \