Remove resetting of the internal csync error state.

Resetting this in trivial helper functions leads to the fact that
error conditions happening in functions calling these helpers get
lost which should not happen.
This commit is contained in:
Klaas Freitag 2013-10-11 10:21:59 +02:00
parent c34b861332
commit f3755bb708

View file

@ -917,7 +917,6 @@ int csync_add_exclude_list(CSYNC *ctx, const char *path) {
if (ctx == NULL || path == NULL) {
return -1;
}
ctx->error_code = CSYNC_ERR_NONE;
return csync_exclude_load(ctx, path);
}
@ -931,7 +930,6 @@ const char *csync_get_config_dir(CSYNC *ctx) {
if (ctx == NULL) {
return NULL;
}
ctx->error_code = CSYNC_ERR_NONE;
return ctx->options.config_dir;
}
@ -940,7 +938,6 @@ int csync_set_config_dir(CSYNC *ctx, const char *path) {
if (ctx == NULL || path == NULL) {
return -1;
}
ctx->error_code = CSYNC_ERR_NONE;
SAFE_FREE(ctx->options.config_dir);
ctx->options.config_dir = c_strdup(path);
@ -959,7 +956,9 @@ int csync_enable_statedb(CSYNC *ctx) {
ctx->error_code = CSYNC_ERR_NONE;
if (ctx->status & CSYNC_STATUS_INIT) {
ctx->error_code = CSYNC_ERR_UNSPEC;
if (ctx->error_code == CSYNC_ERR_NONE) {
ctx->error_code = CSYNC_ERR_UNSPEC;
}
fprintf(stderr, "csync_enable_statedb: This function must be called before initialization.\n");
return -1;
}
@ -990,8 +989,6 @@ int csync_is_statedb_disabled(CSYNC *ctx) {
if (ctx == NULL) {
return -1;
}
ctx->error_code = CSYNC_ERR_NONE;
return ctx->statedb.disabled;
}
@ -999,7 +996,6 @@ int csync_set_auth_callback(CSYNC *ctx, csync_auth_callback cb) {
if (ctx == NULL || cb == NULL) {
return -1;
}
ctx->error_code = CSYNC_ERR_NONE;
if (ctx->status & CSYNC_STATUS_INIT) {
fprintf(stderr, "csync_set_auth_callback: This function must be called before initialization.\n");
@ -1052,8 +1048,6 @@ void *csync_get_userdata(CSYNC *ctx) {
if (ctx == NULL) {
return NULL;
}
ctx->error_code = CSYNC_ERR_NONE;
return ctx->callbacks.userdata;
}
@ -1061,7 +1055,6 @@ int csync_set_userdata(CSYNC *ctx, void *userdata) {
if (ctx == NULL) {
return -1;
}
ctx->error_code = CSYNC_ERR_NONE;
ctx->callbacks.userdata = userdata;
@ -1072,7 +1065,6 @@ csync_auth_callback csync_get_auth_callback(CSYNC *ctx) {
if (ctx == NULL) {
return NULL;
}
ctx->error_code = CSYNC_ERR_NONE;
return ctx->callbacks.auth_function;
}
@ -1089,7 +1081,6 @@ int csync_set_status(CSYNC *ctx, int status) {
if (ctx == NULL || status < 0) {
return -1;
}
ctx->error_code = CSYNC_ERR_NONE;
ctx->status = status;
@ -1100,7 +1091,6 @@ int csync_get_status(CSYNC *ctx) {
if (ctx == NULL) {
return -1;
}
ctx->error_code = CSYNC_ERR_NONE;
return ctx->status;
}
@ -1109,7 +1099,6 @@ int csync_enable_conflictcopys(CSYNC* ctx){
if (ctx == NULL) {
return -1;
}
ctx->error_code = CSYNC_ERR_NONE;
if (ctx->status & CSYNC_STATUS_INIT) {
fprintf(stderr, "csync_enable_conflictcopys: This function must be called before initialization.\n");