mirror of
https://git.code.sf.net/p/isync/isync
synced 2025-12-11 20:37:54 +01:00
don't try to create already existing boxes
if the SELECT command fails even though the box was LISTed, then the error cause is obviously not that box is absent, and so we should not attempt to CREATE it.
This commit is contained in:
13
src/sync.c
13
src/sync.c
@@ -377,10 +377,13 @@ sync_boxes( store_t *ctx[], const char * const names[], int present[], channel_c
|
||||
sync_ref( svars );
|
||||
for (t = 0; ; t++) {
|
||||
info( "Opening %s box %s...\n", str_fn[t], svars->orig_name[t] );
|
||||
if (present[t] == BOX_ABSENT)
|
||||
if (present[t] == BOX_ABSENT) {
|
||||
box_confirmed2( svars, t );
|
||||
else
|
||||
} else {
|
||||
if (present[t] == BOX_PRESENT)
|
||||
svars->state[t] |= ST_PRESENT;
|
||||
svars->drv[t]->open_box( ctx[t], box_confirmed, AUX );
|
||||
}
|
||||
if (t || check_cancel( svars ))
|
||||
break;
|
||||
}
|
||||
@@ -399,6 +402,12 @@ box_confirmed( int sts, uint uidvalidity, void *aux )
|
||||
if (sts == DRV_OK) {
|
||||
svars->state[t] |= ST_PRESENT;
|
||||
svars->newuidval[t] = uidvalidity;
|
||||
} else if (svars->state[t] & ST_PRESENT) {
|
||||
error( "Error: channel %s: %s box %s cannot be opened.\n",
|
||||
svars->chan->name, str_fn[t], svars->orig_name[t] );
|
||||
svars->ret |= SYNC_FAIL;
|
||||
cancel_sync( svars );
|
||||
return;
|
||||
}
|
||||
box_confirmed2( svars, t );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user