aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLizzy Fleckenstein <lizzy@vlhl.dev>2026-04-01 20:46:40 +0200
committerLizzy Fleckenstein <lizzy@vlhl.dev>2026-04-01 20:46:40 +0200
commitd78242bd5e0028431bd983f7a48e74ecad6ee4dd (patch)
tree16ee14dd7e3450a05676d32e5186321d3eb2c952
parentabda2001b80bc71f48cfbdc02a4f8988e5f30a39 (diff)
downloadburstdog-d78242bd5e0028431bd983f7a48e74ecad6ee4dd.tar.xz
enforce minimum of 2 samples
-rw-r--r--watchdog.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/watchdog.c b/watchdog.c
index e547aae..12df687 100644
--- a/watchdog.c
+++ b/watchdog.c
@@ -16,6 +16,10 @@
#define WATCHDOG_BURST_END 90 // cpu time percentage considered the end of a burst
#define WATCHDOG_SAMPLES 5 // how many samples a burst needs to persist for to be logged
+#if WATCHDOG_SAMPLES < 2
+#error must consider at least 2 samples
+#endif
+
// arbitrary limits, bump if necessary
#define MAX_PROCESS 4096
#define DIRBUFFER_SIZE 262144