commit 30cbc8ec2e571c5039947ffd0d0e3360581f4d08 Author: Oswald Buddenhagen <o...@kde.org> Date: Sun Apr 3 16:23:52 2011 +0200
make drv->cancel callback have no status code this function is not going to actually execute any commands, so it makes no sense for it to return a status code. src/drv_imap.c | 4 ++-- src/drv_maildir.c | 4 ++-- src/isync.h | 2 +- src/sync.c | 16 +++++++--------- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/drv_imap.c b/src/drv_imap.c index cfd9394..6257174 100644 --- a/src/drv_imap.c +++ b/src/drv_imap.c @@ -1728,10 +1728,10 @@ imap_list( store_t *gctx, static void imap_cancel( store_t *gctx, - void (*cb)( int sts, void *aux ), void *aux ) + void (*cb)( void *aux ), void *aux ) { (void)gctx; - cb( DRV_OK, aux ); + cb( aux ); } static void diff --git a/src/drv_maildir.c b/src/drv_maildir.c index 5213922..4d54803 100644 --- a/src/drv_maildir.c +++ b/src/drv_maildir.c @@ -1206,10 +1206,10 @@ maildir_close( store_t *gctx, static void maildir_cancel( store_t *gctx, - void (*cb)( int sts, void *aux ), void *aux ) + void (*cb)( void *aux ), void *aux ) { (void)gctx; - cb( DRV_OK, aux ); + cb( aux ); } static void diff --git a/src/isync.h b/src/isync.h index 7f05796..c831b77 100644 --- a/src/isync.h +++ b/src/isync.h @@ -210,7 +210,7 @@ struct driver { int (*close)( store_t *ctx, /* IMAP-style: expunge inclusive */ int (*cb)( int sts, void *aux ), void *aux ); void (*cancel)( store_t *ctx, /* only not yet sent commands */ - void (*cb)( int sts, void *aux ), void *aux ); + void (*cb)( void *aux ), void *aux ); void (*commit)( store_t *ctx ); }; diff --git a/src/sync.c b/src/sync.c index 052c578..880ecfd 100644 --- a/src/sync.c +++ b/src/sync.c @@ -383,7 +383,7 @@ stats( sync_vars_t *svars ) static void sync_bail( sync_vars_t *svars ); static void sync_bail1( sync_vars_t *svars ); static void sync_bail2( sync_vars_t *svars ); -static void cancel_done( int sts, void *aux ); +static void cancel_done( void *aux ); static void cancel_sync( sync_vars_t *svars ) @@ -392,21 +392,19 @@ cancel_sync( sync_vars_t *svars ) /* the 1st round is guaranteed not to trash svars */ for (t = 0; t < 2; t++) - if (svars->ret & SYNC_BAD(t)) - cancel_done( DRV_STORE_BAD, AUX ); - else + if (svars->ret & SYNC_BAD(t)) { + svars->drv[t]->cancel_store( svars->ctx[t] ); + cancel_done( AUX ); + } else { svars->drv[t]->cancel( svars->ctx[t], cancel_done, AUX ); + } } static void -cancel_done( int sts, void *aux ) +cancel_done( void *aux ) { SVARS(aux) - if (sts != DRV_OK) { - svars->ret |= SYNC_BAD(t); - svars->drv[t]->cancel_store( svars->ctx[t] ); - } svars->state[t] |= ST_CANCELED; if (svars->state[1-t] & ST_CANCELED) { Fclose( svars->nfp ); ------------------------------------------------------------------------------ Xperia(TM) PLAY It's a major breakthrough. An authentic gaming smartphone on the nation's most reliable network. And it wants your games. http://p.sf.net/sfu/verizon-sfdev _______________________________________________ isync-devel mailing list isync-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/isync-devel