| 7141 | static int g_agent_uninstall_errors = 0; |
| 7142 | |
| 7143 | static void plan_record(const char *agent, const char *kind, const char *path) { |
| 7144 | if (!g_install_plan || !path || !path[0]) { |
| 7145 | return; |
| 7146 | } |
| 7147 | cbm_install_plan_t *pl = g_install_plan; |
| 7148 | if (pl->count >= pl->cap) { |
| 7149 | int ncap = pl->cap ? pl->cap * 2 : CLI_BUF_16; |
| 7150 | cbm_plan_entry_t *ni = realloc(pl->items, (size_t)ncap * sizeof(*ni)); |
| 7151 | if (!ni) { |
| 7152 | return; |
| 7153 | } |
| 7154 | pl->items = ni; |
| 7155 | pl->cap = ncap; |
| 7156 | } |
| 7157 | cbm_plan_entry_t *e = &pl->items[pl->count++]; |
| 7158 | snprintf(e->agent, sizeof(e->agent), "%s", agent); |
| 7159 | snprintf(e->kind, sizeof(e->kind), "%s", kind); |
| 7160 | snprintf(e->path, sizeof(e->path), "%s", path); |
| 7161 | } |
| 7162 | |
| 7163 | static void record_agent_config_error(bool uninstalling, const char *agent, const char *operation, |
| 7164 | const char *path) { |
no outgoing calls
no test coverage detected