mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-29 00:26:33 +03:00
Let csync_update report the right error.
The problem is that the call to csync_memstat_check will try to open a file, that will fail on windows and override the errno
This commit is contained in:
parent
f320f9c701
commit
bb03664bfd
1 changed files with 10 additions and 10 deletions
20
src/csync.c
20
src/csync.c
|
@ -402,6 +402,11 @@ int csync_update(CSYNC *ctx) {
|
|||
ctx->replica = ctx->local.type;
|
||||
|
||||
rc = csync_ftw(ctx, ctx->local.uri, csync_walker, MAX_DEPTH);
|
||||
if (rc < 0) {
|
||||
if(ctx->error_code == CSYNC_ERR_NONE)
|
||||
ctx->error_code = csync_errno_to_csync_error(CSYNC_ERR_UPDATE);
|
||||
return -1;
|
||||
}
|
||||
|
||||
csync_gettime(&finish);
|
||||
|
||||
|
@ -410,11 +415,6 @@ int csync_update(CSYNC *ctx) {
|
|||
c_secdiff(finish, start), c_rbtree_size(ctx->local.tree));
|
||||
csync_memstat_check(ctx);
|
||||
|
||||
if (rc < 0) {
|
||||
if(ctx->error_code == CSYNC_ERR_NONE)
|
||||
ctx->error_code = csync_errno_to_csync_error(CSYNC_ERR_UPDATE);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* update detection for remote replica */
|
||||
if( ! ctx->options.local_only_mode ) {
|
||||
|
@ -423,6 +423,11 @@ int csync_update(CSYNC *ctx) {
|
|||
ctx->replica = ctx->remote.type;
|
||||
|
||||
rc = csync_ftw(ctx, ctx->remote.uri, csync_walker, MAX_DEPTH);
|
||||
if (rc < 0) {
|
||||
if(ctx->error_code == CSYNC_ERR_NONE )
|
||||
ctx->error_code = csync_errno_to_csync_error(CSYNC_ERR_UPDATE);
|
||||
return -1;
|
||||
}
|
||||
csync_gettime(&finish);
|
||||
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG,
|
||||
|
@ -431,11 +436,6 @@ int csync_update(CSYNC *ctx) {
|
|||
c_secdiff(finish, start), c_rbtree_size(ctx->remote.tree));
|
||||
csync_memstat_check(ctx);
|
||||
|
||||
if (rc < 0) {
|
||||
if(ctx->error_code == CSYNC_ERR_NONE )
|
||||
ctx->error_code = csync_errno_to_csync_error(CSYNC_ERR_UPDATE);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
ctx->status |= CSYNC_STATUS_UPDATE;
|
||||
|
||||
|
|
Loading…
Reference in a new issue