Improved the build rule for getfsdev and added getfsdev.o to the
[rsync/rsync.git] / main.c
diff --git a/main.c b/main.c
index c4b8333..412c2e2 100644 (file)
--- a/main.c
+++ b/main.c
@@ -43,6 +43,7 @@ extern int local_server;
 extern int log_got_error;
 extern int module_id;
 extern int orig_umask;
+extern int copy_links;
 extern int keep_dirlinks;
 extern int preserve_hard_links;
 extern int protocol_version;
@@ -378,9 +379,13 @@ static char *get_local_name(struct file_list *flist,char *name)
        if (do_mkdir(name,0777 & ~orig_umask) != 0) {
                rsyserr(FERROR, errno, "mkdir %s failed", full_fname(name));
                exit_cleanup(RERR_FILEIO);
-       } else {
-               if (verbose > 0)
-                       rprintf(FINFO,"created directory %s\n",name);
+       }
+       if (verbose > 0)
+               rprintf(FINFO, "created directory %s\n", name);
+
+       if (dry_run) {
+               dry_run++;
+               return NULL;
        }
 
        if (!push_dir(name)) {
@@ -458,6 +463,10 @@ static int do_recv(int f_in,int f_out,struct file_list *flist,char *local_name)
        int status = 0;
        int error_pipe[2];
 
+       /* The receiving side mustn't obey this, or an existing symlink that
+        * points to an identical file won't be replaced by the referent. */
+       copy_links = 0;
+
        if (preserve_hard_links)
                init_hard_links(flist);