diff options
author | Alexis Hildebrandt <afh@surryhill.net> | 2015-07-06 15:39:34 +0200 |
---|---|---|
committer | Alexis Hildebrandt <afh@surryhill.net> | 2015-07-06 15:48:33 +0200 |
commit | 2113737107c537e9cbc1a40d2d8d5fac5152e03e (patch) | |
tree | 11eec87bb4f32fe0f35cce58fccbf99cb047ea75 /i3status.c | |
parent | d1cec2632dab678d6eb55c319756e98faf95a7f0 (diff) |
Use gettimeofday instead of clock_gettime on Mac
since the latter is not available.
Diffstat (limited to 'i3status.c')
-rw-r--r-- | i3status.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -692,7 +692,12 @@ int main(int argc, char *argv[]) { * We also align to 60 seconds modulo interval such * that we start with :00 on every new minute. */ struct timespec ts; +#if defined(__APPLE__) + gettimeofday(&tv, NULL); + ts.tv_sec = tv.tv_sec; +#else clock_gettime(CLOCK_REALTIME, &ts); +#endif ts.tv_sec += interval - (ts.tv_sec % interval); ts.tv_nsec = 0; |