don't crash when select() on master fails synchronously

svars->drv[S] would not be initialized yet, so cancel_sync() would
crash.
This commit is contained in:
Oswald Buddenhagen 2012-08-25 15:34:26 +02:00
parent 28cccf4b35
commit 343f16771a

View File

@ -611,6 +611,10 @@ sync_boxes( store_t *ctx[], const char *names[], channel_conf_t *chan,
ctx[t]->uidvalidity = -1; ctx[t]->uidvalidity = -1;
set_bad_callback( ctx[t], store_bad, AUX ); set_bad_callback( ctx[t], store_bad, AUX );
svars->drv[t] = ctx[t]->conf->driver; svars->drv[t] = ctx[t]->conf->driver;
}
/* Both boxes must be fully set up at this point, so that error exit paths
* don't run into uninitialized variables. */
for (t = 0; t < 2; t++) {
info( "Selecting %s %s...\n", str_ms[t], ctx[t]->name ); info( "Selecting %s %s...\n", str_ms[t], ctx[t]->name );
DRIVER_CALL(select( ctx[t], (chan->ops[t] & OP_CREATE) != 0, box_selected, AUX )); DRIVER_CALL(select( ctx[t], (chan->ops[t] & OP_CREATE) != 0, box_selected, AUX ));
} }