diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-03-14 14:54:53 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-03-14 14:54:53 +0900 |
| commit | bf524e7002f69f5eed706d3b261635049a34ef65 (patch) | |
| tree | ed2fd0b76f500a2118302c6ef97cf34e2e17e578 /mrbgems/mruby-time | |
| parent | f92a27f918edb61f6c75d85da90009824d54bb23 (diff) | |
| download | mruby-bf524e7002f69f5eed706d3b261635049a34ef65.tar.gz mruby-bf524e7002f69f5eed706d3b261635049a34ef65.zip | |
time.c: calendar clock should use `CLOCK_REALTIME`; 5e95f11
The issue was reported by @shuujii
Diffstat (limited to 'mrbgems/mruby-time')
| -rw-r--r-- | mrbgems/mruby-time/src/time.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mrbgems/mruby-time/src/time.c b/mrbgems/mruby-time/src/time.c index 15ec7f362..907e3fcd2 100644 --- a/mrbgems/mruby-time/src/time.c +++ b/mrbgems/mruby-time/src/time.c @@ -387,10 +387,10 @@ current_mrb_time(mrb_state *mrb) sec = ts.tv_sec; usec = ts.tv_nsec / 1000; } -#elif (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0) && defined(CLOCK_MONOTONIC) +#elif (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0) && defined(CLOCK_REALTIME) { struct timespec ts; - clock_gettime(CLOCK_MONOTONIC, &ts); + clock_gettime(CLOCK_REALTIME, &ts); sec = ts.tv_sec; usec = ts.tv_nsec / 1000; } |
