Fix setting of csync error code in updater.

This commit is contained in:
Klaas Freitag 2013-05-09 14:12:26 +02:00
parent 9d84c19b69
commit 276ccd3fb6

View file

@ -36,6 +36,7 @@
#include "csync_statedb.h" #include "csync_statedb.h"
#include "csync_update.h" #include "csync_update.h"
#include "csync_util.h" #include "csync_util.h"
#include "csync_misc.h"
#include "vio/csync_vio.h" #include "vio/csync_vio.h"
@ -413,7 +414,7 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
if ((dh = csync_vio_opendir(ctx, uri)) == NULL) { if ((dh = csync_vio_opendir(ctx, uri)) == NULL) {
/* permission denied */ /* permission denied */
if (errno == EACCES) { if (errno == EACCES) {
return 0; return 0;
} else if(errno == EIO ) { } else if(errno == EIO ) {
/* Proxy problems (ownCloud) */ /* Proxy problems (ownCloud) */
ctx->error_code = CSYNC_ERR_PROXY; ctx->error_code = CSYNC_ERR_PROXY;
@ -423,6 +424,7 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR,
"opendir failed for %s - %s (errno %d)", "opendir failed for %s - %s (errno %d)",
uri, errbuf, errno); uri, errbuf, errno);
ctx->error_code = csync_errno_to_csync_error( CSYNC_ERR_UPDATE );
goto error; goto error;
} }
} }
@ -433,6 +435,7 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
d_name = dirent->name; d_name = dirent->name;
if (d_name == NULL) { if (d_name == NULL) {
ctx->error_code = CSYNC_ERR_PARAM;
goto error; goto error;
} }
@ -447,6 +450,7 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
if (asprintf(&filename, "%s/%s", uri, d_name) < 0) { if (asprintf(&filename, "%s/%s", uri, d_name) < 0) {
csync_vio_file_stat_destroy(dirent); csync_vio_file_stat_destroy(dirent);
dirent = NULL; dirent = NULL;
ctx->error_code = CSYNC_ERR_PARAM;
goto error; goto error;
} }