io BUGFIX ppoll timeout is relative, not absolute
pthread_mutex_timedlock timeout is absolute :/
diff --git a/src/io.c b/src/io.c
index 31f9782..a3981df 100644
--- a/src/io.c
+++ b/src/io.c
@@ -441,10 +441,12 @@
fds.revents = 0;
if (timeout > -1) {
- clock_gettime(CLOCK_REALTIME, &ts_timeout);
- if (timeout > 0) {
- ts_timeout.tv_sec += timeout / 1000;
- ts_timeout.tv_nsec += (timeout % 1000) * 1000000;
+ if (!timeout) {
+ ts_timeout.tv_sec = 0;
+ ts_timeout.tv_nsec = 0;
+ } else if (timeout > 0) {
+ ts_timeout.tv_sec = timeout / 1000;
+ ts_timeout.tv_nsec = (timeout % 1000) * 1000000;
}
}
sigfillset(&sigmask);