Fixed recv_add_uid() to properly differentiate users and groups.
[rsync/rsync.git] / receiver.c
index 7efd3d2..0135e42 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (C) 1996-2000 Andrew Tridgell
  * Copyright (C) 1996 Paul Mackerras
- * Copyright (C) 2003-2008 Wayne Davison
+ * Copyright (C) 2003-2009 Wayne Davison
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -285,11 +285,10 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
                goto report_write_error;
 
 #ifdef HAVE_FTRUNCATE
-       if (inplace && fd != -1) {
-               if (ftruncate(fd, offset) < 0) {
-                       rsyserr(FWARNING, errno, "ftruncate failed on %s",
-                               full_fname(fname));
-               }
+       if (inplace && fd != -1
+        && ftruncate(fd, offset) < 0) {
+               rsyserr(FERROR_XFER, errno, "ftruncate failed on %s",
+                       full_fname(fname));
        }
 #endif
 
@@ -332,7 +331,7 @@ static void handle_delayed_updates(char *local_name)
                struct file_struct *file = cur_flist->files[ndx];
                fname = local_name ? local_name : f_name(file, NULL);
                if ((partialptr = partial_dir_fname(fname)) != NULL) {
-                       if (make_backups > 0 && !make_backup(fname))
+                       if (make_backups > 0 && !make_backup(fname, False))
                                continue;
                        if (DEBUG_GTE(RECV, 1)) {
                                rprintf(FINFO, "renaming %s to %s\n",