diff --git a/src/csync_private.h b/src/csync_private.h index 1c26f819c..5eaed7966 100644 --- a/src/csync_private.h +++ b/src/csync_private.h @@ -179,6 +179,7 @@ struct csync_file_stat_s { int nlink; /* u32 */ int type; /* u32 */ int child_modified;/*bool*/ + int should_update_md5; /*bool */ char *destpath; /* for renames */ const char *md5; diff --git a/src/csync_update.c b/src/csync_update.c index 60a080750..2cff298d7 100644 --- a/src/csync_update.c +++ b/src/csync_update.c @@ -542,8 +542,10 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn, } if (ctx->current_fs && !ctx->current_fs->child_modified - && ctx->current_fs->instruction == CSYNC_INSTRUCTION_EVAL) + && ctx->current_fs->instruction == CSYNC_INSTRUCTION_EVAL) { ctx->current_fs->instruction = CSYNC_INSTRUCTION_NONE; + ctx->current_fs->should_update_md5 = true; + } } ctx->current_fs = previous_fs; SAFE_FREE(filename); diff --git a/src/csync_util.c b/src/csync_util.c index 5b6753c93..74e125790 100644 --- a/src/csync_util.c +++ b/src/csync_util.c @@ -120,7 +120,7 @@ static int _merge_file_trees_visitor(void *obj, void *data) { ctx = (CSYNC *) data; /* search for UPDATED file */ - if (fs->instruction != CSYNC_INSTRUCTION_UPDATED) { + if (fs->instruction != CSYNC_INSTRUCTION_UPDATED && !fs->should_update_md5) { rc = 0; goto out; }