use more appropriate return value in driver_t::select_box()

don't say DRV_CANCELED when it's really DRV_STORE_BAD, as apart from
being just wrong, it lead to the confusing effect of canceling a store
as the result of a supposed cancellation of the same store.
This commit is contained in:
Oswald Buddenhagen 2020-08-04 00:23:33 +02:00
parent 481c12a8b3
commit 8457225a50
2 changed files with 2 additions and 2 deletions

View File

@ -1269,7 +1269,7 @@ maildir_select_box( store_t *gctx, const char *name )
} }
} else { } else {
if (!(ctx->path = maildir_join_path( conf, 0, name ))) if (!(ctx->path = maildir_join_path( conf, 0, name )))
return DRV_CANCELED; return DRV_STORE_BAD;
ctx->is_inbox = 0; ctx->is_inbox = 0;
} }
return ctx->path ? DRV_OK : DRV_BOX_BAD; return ctx->path ? DRV_OK : DRV_BOX_BAD;

View File

@ -1190,7 +1190,7 @@ sync_boxes( store_t *ctx[], const char * const names[], int present[], channel_c
* don't run into uninitialized variables. */ * don't run into uninitialized variables. */
for (t = 0; t < 2; t++) { for (t = 0; t < 2; t++) {
switch (svars->drv[t]->select_box( ctx[t], svars->box_name[t] )) { switch (svars->drv[t]->select_box( ctx[t], svars->box_name[t] )) {
case DRV_CANCELED: case DRV_STORE_BAD:
store_bad( AUX ); store_bad( AUX );
return; return;
case DRV_BOX_BAD: case DRV_BOX_BAD: