When a file cannot be deleted because of ETXTBSY (in particular, when an
[rsync/rsync.git] / generator.c
index b772d33..8b0eeab 100644 (file)
@@ -31,6 +31,7 @@ extern int whole_file;
 extern int block_size;
 extern int csum_length;
 extern int ignore_times;
+extern int size_only;
 extern int io_timeout;
 extern int remote_version;
 extern int always_checksum;
@@ -52,6 +53,10 @@ static int skip_file(char *fname,
                return (memcmp(sum,file->sum,csum_length) == 0);
        }
 
+       if (size_only) {
+               return 1;
+       }
+
        if (ignore_times) {
                return 0;
        }
@@ -177,7 +182,7 @@ void recv_generator(char *fname,struct file_list *flist,int i,int f_out)
        if (S_ISDIR(file->mode)) {
                if (dry_run) return;
                if (statret == 0 && !S_ISDIR(st.st_mode)) {
-                       if (do_unlink(fname) != 0) {
+                       if (robust_unlink(fname) != 0) {
                                rprintf(FERROR,"unlink %s : %s\n",fname,strerror(errno));
                                return;
                        }