Set the right mode during open.

This gives us a speedup about 60 seconds copying the linux kernel sources.
This commit is contained in:
Andreas Schneider 2008-06-05 13:32:23 +02:00
parent 34e59bae46
commit 13f82f25ff

View File

@ -148,7 +148,7 @@ static int _csync_push_file(CSYNC *ctx, csync_file_stat_t *st) {
if (csync_vio_mkdirs(ctx, tdir, 0755) < 0) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_WARN, "dir: %s, command: mkdirs, error: %s", tdir, strerror(errno));
}
dfp = csync_vio_creat(ctx, turi, 0644);
dfp = csync_vio_creat(ctx, turi, st->mode);
}
/* copy file */
@ -212,10 +212,6 @@ static int _csync_push_file(CSYNC *ctx, csync_file_stat_t *st) {
goto out;
}
/* sync modes */
ctx->replica = drep;
csync_vio_chmod(ctx, duri, st->mode);
/* sync time */
times[0].tv_sec = times[1].tv_sec = st->modtime;
times[0].tv_usec = times[1].tv_usec = 0;