diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2026-11-06 14:24:04 +0100 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2026-11-06 14:24:04 +0100 |
| commit | 355c8ae57d582974f4f6a4ba42f635f2253b84a7 (patch) | |
| tree | 81536ae109b37242217c818ae3a6b2c193fb8ff3 /src/trackerlogic.h | |
| parent | 367ff65242ca88fd6435d04a577a43cec5de92fe (diff) | |
Add a wall clock helper so that statedumps can be written and re-read
Diffstat (limited to 'src/trackerlogic.h')
| -rw-r--r-- | src/trackerlogic.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/trackerlogic.h b/src/trackerlogic.h index d03d3b1..241b6a7 100644 --- a/src/trackerlogic.h +++ b/src/trackerlogic.h | |||
| @@ -114,6 +114,11 @@ static inline ot_time time_since_minutes(ot_time then) { | |||
| 114 | 114 | ||
| 115 | /* Has a deadline the tracker set on itself gone by? */ | 115 | /* Has a deadline the tracker set on itself gone by? */ |
| 116 | static inline int time_is_past(ot_time deadline) { return time_now_seconds() > deadline; } | 116 | static inline int time_is_past(ot_time deadline) { return time_now_seconds() > deadline; } |
| 117 | |||
| 118 | /* The wall clock, which the state file uses and nothing else does: it has to | ||
| 119 | survive a restart, and the clock above counts from boot. */ | ||
| 120 | static inline ot_time time_wall_minutes(void) { return time(NULL) / 60; } | ||
| 121 | |||
| 117 | /* Cleared from the interrupt handler and read by every worker */ | 122 | /* Cleared from the interrupt handler and read by every worker */ |
| 118 | extern _Atomic int g_opentracker_running; | 123 | extern _Atomic int g_opentracker_running; |
| 119 | 124 | ||
