print a warning when calling set_module_property at the wrong time

This commit is contained in:
Olivier Goffart 2012-12-06 17:58:36 +01:00 committed by Klaas Freitag
parent 3f24ab599c
commit 410eadf2f5

View File

@ -1009,6 +1009,11 @@ bool csync_file_known( char *statedb_file, const char* url ) {
int csync_set_module_property(CSYNC* ctx, const char* key, void* value)
{
if (!(ctx->status & CSYNC_STATUS_INIT)) {
ctx->error_code = CSYNC_ERR_UNSPEC;
fprintf(stderr, "This function must be called after initialization.");
return -1;
}
return csync_vio_set_property(ctx, key, value);
}