diff options
| author | Michael Forney <mforney@mforney.org> | 2017-03-09 08:27:45 -0800 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2017-03-09 08:27:45 -0800 |
| commit | f2cb60938705b9cf3480c4006d8a48797ce96044 (patch) | |
| tree | ab9dd386819e97753d7404225daa182b18b4eeef /pkg/openbsd/patch | |
| parent | b6fe8ecc7e939cdd60322db9cf549ab3acc2f65d (diff) | |
openbsd/doas: Use CLOCK_BOOTTIME for timestamp files
This way, we take in to account time while the system is suspended.
Diffstat (limited to 'pkg/openbsd/patch')
| -rw-r--r-- | pkg/openbsd/patch/0017-doas-Port-to-linux-musl.patch | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/openbsd/patch/0017-doas-Port-to-linux-musl.patch b/pkg/openbsd/patch/0017-doas-Port-to-linux-musl.patch index 52b5d9f7..08c49d5b 100644 --- a/pkg/openbsd/patch/0017-doas-Port-to-linux-musl.patch +++ b/pkg/openbsd/patch/0017-doas-Port-to-linux-musl.patch @@ -1,4 +1,4 @@ -From 8f291c14b3c345ec66fb530dd719b2106ddc25e2 Mon Sep 17 00:00:00 2001 +From 1b13579bba43fabda6165cb2354c9eb61467b03e Mon Sep 17 00:00:00 2001 From: Michael Forney <mforney@mforney.org> Date: Sun, 26 Feb 2017 16:50:55 -0800 Subject: [PATCH] doas: Port to linux/musl @@ -270,7 +270,7 @@ index 9a30e1ea7..fb59d3130 100644 #include <stdio.h> diff --git a/usr.bin/doas/persist.c b/usr.bin/doas/persist.c new file mode 100644 -index 000000000..1ba1560d4 +index 000000000..dd9cc0411 --- /dev/null +++ b/usr.bin/doas/persist.c @@ -0,0 +1,128 @@ @@ -370,7 +370,7 @@ index 000000000..1ba1560d4 + } + *valid = 0; + } else { -+ *valid = clock_gettime(CLOCK_MONOTONIC, &ts) == 0 && ++ *valid = clock_gettime(CLOCK_BOOTTIME, &ts) == 0 && + fstat(fd, &st) == 0 && + (ts.tv_sec < st.st_mtim.tv_sec || + ts.tv_sec == st.st_mtim.tv_sec && ts.tv_nsec < st.st_mtim.tv_nsec) && @@ -384,7 +384,7 @@ index 000000000..1ba1560d4 +{ + struct timespec times[2]; + -+ if (clock_gettime(CLOCK_MONOTONIC, ×[1]) < 0) ++ if (clock_gettime(CLOCK_BOOTTIME, ×[1]) < 0) + return -1; + times[0].tv_nsec = UTIME_OMIT; + times[1].tv_sec += PERSIST_TIMEOUT; |
