| 2933 | } replace_during_poll_ctx_t; |
| 2934 | |
| 2935 | static int replace_during_poll_callback(const char *name, const char *path, void *ud) { |
| 2936 | (void)path; |
| 2937 | replace_during_poll_ctx_t *ctx = ud; |
| 2938 | ctx->calls++; |
| 2939 | /* Re-registering can happen when a second daemon session initializes while |
| 2940 | * this project's watcher snapshot is being polled. The old state must stay |
| 2941 | * alive until the snapshot finishes using it. */ |
| 2942 | cbm_watcher_watch(ctx->watcher, name, ctx->replacement_root); |
| 2943 | return 0; |
| 2944 | } |
| 2945 | |
| 2946 | TEST(watcher_replace_during_poll_defers_old_state_free) { |
| 2947 | char original[256]; |
nothing calls this directly
no test coverage detected