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. */
| 784 | * each call so tests/operators can adjust via setenv without a restart — |
| 785 | * same convention as cbm_max_file_bytes in limits.c. */ |
| 786 | static long prune_grace_s(void) { |
| 787 | const char *raw = getenv("CBM_WATCHER_PRUNE_GRACE_S"); |
| 788 | if (raw && raw[0]) { |
| 789 | errno = 0; |
| 790 | char *end = NULL; |
| 791 | long v = strtol(raw, &end, 10); |
| 792 | if (errno == 0 && end != raw && *end == '\0' && v >= 0) { |
| 793 | return v; |
| 794 | } |
| 795 | /* Unparseable / negative → fall through to the safe default. */ |
| 796 | } |
| 797 | return PRUNE_GRACE_DEFAULT_S; |
| 798 | } |
| 799 | |
| 800 | /* Format int to string for logging (poll thread only, one use per call). */ |
| 801 | static const char *itoa_buf(int v) { |
no outgoing calls
no test coverage detected