Try to create remote directory if it doesn't exists or throw an error.

This commit is contained in:
Andreas Schneider 2008-05-15 17:13:03 +02:00
parent 4489fbfa2b
commit db839ef5d3

View File

@ -47,7 +47,10 @@ time_t csync_timediff(CSYNC *ctx) {
ctx->replica = ctx->remote.type;
dp = csync_vio_opendir(ctx, ctx->remote.uri);
if (dp == NULL) {
return -1;
if (csync_vio_local_mkdir(ctx->remote.uri, 0755) < 0) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_FATAL, "Unable to create directory on remote uri: %s - %s", luri, strerror(errno));
return -1;
}
}
csync_vio_closedir(ctx, dp);