]> git.armaanb.net Git - opendoas.git/commitdiff
persist_timestamp: use CLOCK_MONOTONIC_RAW
authorDuncaen <mail@duncano.de>
Tue, 12 Dec 2017 02:07:52 +0000 (03:07 +0100)
committerDuncaen <mail@duncano.de>
Tue, 12 Dec 2017 02:07:52 +0000 (03:07 +0100)
persist_timestamp.c

index c608dca7f357f83452ed5485e9600cca43f02c3c..c8f4bb5ddd70f4242e3c3b5d86c86163cc4b775c 100644 (file)
@@ -171,7 +171,7 @@ persist_check(int fd, int secs)
        if (!timespecisset(&ts_mono) || !timespecisset(&ts_real))
                errx(1, "timespecisset");
 
-       if (clock_gettime(CLOCK_MONOTONIC, &mono) == -1 ||
+       if (clock_gettime(CLOCK_MONOTONIC_RAW, &mono) == -1 ||
            clock_gettime(CLOCK_REALTIME, &real) == -1)
                err(1, "clock_gettime");
 
@@ -196,7 +196,7 @@ persist_set(int fd, int secs)
 {
        struct timespec mono, real, ts_mono, ts_real, timeout;
 
-       if (clock_gettime(CLOCK_MONOTONIC, &mono) == -1 ||
+       if (clock_gettime(CLOCK_MONOTONIC_RAW, &mono) == -1 ||
            clock_gettime(CLOCK_REALTIME, &real) == -1)
                err(1, "clock_gettime");