From 460bfbb8ac1eb3cb106bd816566f93ff66d2190f Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 1 Jul 2022 14:54:24 +0200 Subject: [PATCH] abort channel sync when a store is fubar this got lost in d5a5da947. this also simplifies a nested condition, where the logic has previously been, but isn't applicable any more. REFMAIL: 87fsjloz05.fsf@wavexx.thregr.org --- src/main_sync.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main_sync.c b/src/main_sync.c index 9c38d20..88baae2 100644 --- a/src/main_sync.c +++ b/src/main_sync.c @@ -668,7 +668,7 @@ static void do_sync_boxes( main_vars_t *mvars ) { mvars->box_cben = 0; - for (;;) { + while (mvars->state[F] == ST_OPEN && mvars->state[N] == ST_OPEN) { if (mvars->chanptr->boxlist) { box_ent_t *mbox = mvars->boxptr; if (!mbox) @@ -730,12 +730,10 @@ done_sync( int sts, void *aux ) stats(); if (sts) { mvars->cvars->ret = 1; - if (sts & (SYNC_BAD(F) | SYNC_BAD(N))) { - if (sts & SYNC_BAD(F)) - mvars->state[F] = ST_CLOSED; - if (sts & SYNC_BAD(N)) - mvars->state[N] = ST_CLOSED; - } + if (sts & SYNC_BAD(F)) + mvars->state[F] = ST_CLOSED; + if (sts & SYNC_BAD(N)) + mvars->state[N] = ST_CLOSED; } mvars->box_done = 1; if (mvars->box_cben)