diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2024-11-19 23:43:46 -0800 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2024-11-20 08:11:14 -0800 |
commit | 73367b12eda9bed587882ad8ec9cc6875a4c2bbc (patch) | |
tree | eeccaeb15441dff735b3242e97399212eebf99a3 | |
parent | d202b2472e10850eadbf2f10a9b5a635a267a8ce (diff) |
vcr: fix us->timespec conversion math typo
An extra 0 snuck in here and got copy and pasted too, oof.
-rw-r--r-- | src/vcr.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -74,6 +74,8 @@ #include "util.h" #include "vcr.h" +#define VCR_USECS_PER_SECOND 1000000 + /* backend is the root vcr object everything else here derives from, * for an X backend it encompasses the xserver/display connection. */ @@ -417,7 +419,7 @@ int vcr_backend_get_dimensions(vcr_backend_t *vbe, int *res_width, int *res_heig /* this is basically just needed by the vmon use case */ -/* returns 1 if the backend has events to process, 0 on timeout/error. */ +/* returns 1 if the backend has events to process, 0 on timeout, -1 on error. */ int vcr_backend_poll(vcr_backend_t *vbe, int timeout_us) { struct timespec ts, *pto = NULL; @@ -427,8 +429,8 @@ int vcr_backend_poll(vcr_backend_t *vbe, int timeout_us) /* TODO: keep signals blocked outside of ppoll() */ if (timeout_us >= 0) { - ts.tv_sec = timeout_us / 10000000; - ts.tv_nsec = (timeout_us - (ts.tv_sec * 10000000)) * 1000; + ts.tv_sec = timeout_us / VCR_USECS_PER_SECOND; + ts.tv_nsec = (timeout_us - (ts.tv_sec * VCR_USECS_PER_SECOND)) * 1000; pto = &ts; } |