If the file did not transfer correctly, only save it if --partial was
authorWayne Davison <wayned@samba.org>
Thu, 13 May 2004 07:08:22 +0000 (07:08 +0000)
committerWayne Davison <wayned@samba.org>
Thu, 13 May 2004 07:08:22 +0000 (07:08 +0000)
specified.  We also skip the setting of the modtime too on a partial
copy (that way the partial file won't be confused with an up-to-date
copy of the original).

receiver.c

index 1975e58..acc5da8 100644 (file)
@@ -45,6 +45,7 @@ extern int cleanup_got_literal;
 extern int module_id;
 extern int ignore_errors;
 extern int orig_umask;
+extern int keep_partial;
 
 static void delete_one(char *fn, int is_dir)
 {
@@ -467,7 +468,10 @@ int recv_files(int f_in,struct file_list *flist,char *local_name)
                if (verbose > 2)
                        rprintf(FINFO,"renaming %s to %s\n",fnametmp,fname);
 
-               finish_transfer(fname, fnametmp, file);
+               if (recv_ok || keep_partial)
+                       finish_transfer(fname, fnametmp, file, recv_ok);
+               else
+                       do_unlink(fnametmp);
 
                cleanup_disable();