Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0f4575db authored by Narayan Kamath's avatar Narayan Kamath Committed by Gerrit Code Review
Browse files

Merge "HAVE_POSIX_CLOCKS doesn't imply CLOCK_BOOTTIME."

parents 4706320e ea659643
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@

nsecs_t systemTime(int clock)
{
#if defined(HAVE_POSIX_CLOCKS)
#if defined(HAVE_ANDROID_OS)
    static const clockid_t clocks[] = {
            CLOCK_REALTIME,
            CLOCK_MONOTONIC,
@@ -47,7 +47,9 @@ nsecs_t systemTime(int clock)
    clock_gettime(clocks[clock], &t);
    return nsecs_t(t.tv_sec)*1000000000LL + t.tv_nsec;
#else
    // we don't support the clocks here.
    // Clock support varies widely across hosts. Mac OS doesn't support
    // posix clocks, older glibcs don't support CLOCK_BOOTTIME and Windows
    // is windows.
    struct timeval t;
    t.tv_sec = t.tv_usec = 0;
    gettimeofday(&t, NULL);