| 1 | diff -u -r ../util-linux-2.28/lib/monotonic.c ./lib/monotonic.c |
| 2 | --- ../util-linux-2.28/lib/monotonic.c 2016-02-19 05:30:53.576131474 -0500 |
| 3 | +++ ./lib/monotonic.c 2016-06-23 06:09:05.035726383 -0400 |
| 4 | @@ -26,6 +26,12 @@ |
| 5 | if (gettimeofday(&now, NULL) != 0) |
| 6 | return -errno; |
| 7 | #ifdef CLOCK_BOOTTIME |
| 8 | +#ifdef __ANDROID__ |
| 9 | +#define TIMESPEC_TO_TIMEVAL(tv, ts) { \ |
| 10 | + (tv)->tv_sec = (ts)->tv_sec; \ |
| 11 | + (tv)->tv_usec = (ts)->tv_nsec / 1000; \ |
| 12 | +} |
| 13 | +#endif |
| 14 | if (clock_gettime(CLOCK_BOOTTIME, &hires_uptime) == 0) { |
| 15 | TIMESPEC_TO_TIMEVAL(&lores_uptime, &hires_uptime); |
| 16 | timersub(&now, &lores_uptime, boot_time); |