Sustained-absence window (seconds) before a missing root may be pruned. * Generous default: 10 minutes. Override with CBM_WATCHER_PRUNE_GRACE_S * (>= 0; 0 prunes as soon as the missing-poll streak is reached). Read on * each call so tests/operators can adjust via setenv without a restart — * same convention as cbm_max_file_bytes in limits.c. */
| 1005 | * each call so tests/operators can adjust via setenv without a restart — |
| 1006 | * same convention as cbm_max_file_bytes in limits.c. */ |
| 1007 | static long prune_grace_s(void) { |
| 1008 | const char *raw = cbm_runtime_getenv("CBM_WATCHER_PRUNE_GRACE_S"); |
| 1009 | if (raw && raw[0]) { |
| 1010 | errno = 0; |
| 1011 | char *end = NULL; |
| 1012 | long v = strtol(raw, &end, 10); |
| 1013 | if (errno == 0 && end != raw && *end == '\0' && v >= 0) { |
| 1014 | return v; |
| 1015 | } |
| 1016 | /* Unparseable / negative → fall through to the safe default. */ |
| 1017 | } |
| 1018 | return PRUNE_GRACE_DEFAULT_S; |
| 1019 | } |
| 1020 | |
| 1021 | /* Format int to string for logging (poll thread only, one use per call). */ |
| 1022 | static const char *itoa_buf(int v) { |
no test coverage detected