From: Wayne Davison Date: Thu, 20 Jan 2005 22:59:54 +0000 (+0000) Subject: Got rid of the erroneous --dry-run short-circuit in the directory X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/027428eb1d7524815d9b29f825033d7902258db5 Got rid of the erroneous --dry-run short-circuit in the directory handling. --- diff --git a/generator.c b/generator.c index 7d60f643..8c786e73 100644 --- a/generator.c +++ b/generator.c @@ -292,18 +292,15 @@ static void recv_generator(char *fname, struct file_struct *file, int i, * to prepare appropriately. If there is already a * file of that name and it is *not* a directory, then * we need to delete it. If it doesn't exist, then - * recursively create it. */ - - if (dry_run) - return; /* TODO: causes inaccuracies -- fix */ + * (perhaps recursively) create it. */ if (statret == 0 && !S_ISDIR(st.st_mode)) { delete_file(fname, DEL_TERSE); statret = -1; } if (statret != 0 && do_mkdir(fname,file->mode) != 0 && errno != EEXIST) { - if (!(relative_paths && errno == ENOENT - && create_directory_path(fname, orig_umask) == 0 - && do_mkdir(fname, file->mode) == 0)) { + if (!relative_paths || errno != ENOENT + || create_directory_path(fname, orig_umask) < 0 + || do_mkdir(fname, file->mode) < 0) { rsyserr(FERROR, errno, "recv_generator: mkdir %s failed", full_fname(fname));