| 247 | } |
| 248 | |
| 249 | static bool |
| 250 | prune_config(invalidate_t **i) |
| 251 | { |
| 252 | invalidate_t *iptr, *ilast; |
| 253 | time_t now; |
| 254 | bool pruned = false; |
| 255 | |
| 256 | now = time(nullptr); |
| 257 | |
| 258 | if (*i) { |
| 259 | iptr = *i; |
| 260 | ilast = nullptr; |
| 261 | while (iptr) { |
| 262 | if (iptr->expiry <= now) { |
| 263 | Dbg(dbg_ctl, "Removing %s expiry: %jd type: %s now: %jd", iptr->regex_text, (intmax_t)iptr->expiry, |
| 264 | strForResult(iptr->new_result), (intmax_t)now); |
| 265 | if (ilast) { |
| 266 | ilast->next = iptr->next; |
| 267 | free_invalidate_t(iptr); |
| 268 | iptr = ilast->next; |
| 269 | } else { |
| 270 | *i = iptr->next; |
| 271 | free_invalidate_t(iptr); |
| 272 | iptr = *i; |
| 273 | } |
| 274 | pruned = true; |
| 275 | } else { |
| 276 | ilast = iptr; |
| 277 | iptr = iptr->next; |
| 278 | } |
| 279 | } |
| 280 | } |
| 281 | return pruned; |
| 282 | } |
| 283 | |
| 284 | static bool |
| 285 | load_state(plugin_state_t *pstate, invalidate_t **ilist) |
no test coverage detected