Records the first failing step. An OS-level step keeps the errno it left; a * step that succeeds clears errno so the next one starts clean. Returns ok, so * the steps chain with &&. */
| 13237 | * step that succeeds clears errno so the next one starts clean. Returns ok, so |
| 13238 | * the steps chain with &&. */ |
| 13239 | static bool cli_update_prep_step(bool ok, const char *step, bool os_level, const char *detail, |
| 13240 | cli_update_prep_failure_t *failure) { |
| 13241 | if (ok) { |
| 13242 | errno = 0; |
| 13243 | return true; |
| 13244 | } |
| 13245 | if (!failure->step) { |
| 13246 | failure->step = step; |
| 13247 | failure->os_error = os_level ? errno : 0; |
| 13248 | failure->detail = detail; |
| 13249 | } |
| 13250 | return false; |
| 13251 | } |
| 13252 | |
| 13253 | static void cli_update_prep_report(const cli_update_prep_failure_t *failure) { |
| 13254 | const char *step = failure->step ? failure->step : "an unrecorded step"; |
no outgoing calls
no test coverage detected