If dry_run is > 1 then the destination directory was missing, so we
authorWayne Davison <wayned@samba.org>
Thu, 5 Aug 2004 18:18:36 +0000 (18:18 +0000)
committerWayne Davison <wayned@samba.org>
Thu, 5 Aug 2004 18:18:36 +0000 (18:18 +0000)
set stat_errno to ENOENT and statret to -1 without calling stat().

generator.c

index 9c78e64..b999ac8 100644 (file)
@@ -273,8 +273,14 @@ static void recv_generator(char *fname, struct file_struct *file, int i,
                return;
        }
 
-       statret = link_stat(fname, &st, keep_dirlinks && S_ISDIR(file->mode));
-       stat_errno = errno;
+       if (dry_run > 1) {
+               statret = -1;
+               stat_errno = ENOENT;
+       } else {
+               statret = link_stat(fname, &st,
+                                   keep_dirlinks && S_ISDIR(file->mode));
+               stat_errno = errno;
+       }
 
        if (only_existing && statret == -1 && stat_errno == ENOENT) {
                /* we only want to update existing files */