Some demon_log_* variables changed into logfile_* variables that are
[rsync/rsync.git] / receiver.c
index 663b1c0..94b6fb4 100644 (file)
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
 #include "rsync.h"
 
 extern int verbose;
 extern int do_xfers;
-extern int am_daemon;
 extern int am_server;
 extern int do_progress;
 extern int log_before_transfer;
 extern int log_format_has_i;
-extern int daemon_log_format_has_i;
+extern int logfile_format_has_i;
 extern int csum_length;
 extern int read_batch;
 extern int write_batch;
@@ -343,8 +342,7 @@ int recv_files(int f_in, struct file_list *flist, char *local_name)
        struct file_struct *file;
        struct stats initial_stats;
        int save_make_backups = make_backups;
-       int itemizing = am_daemon ? daemon_log_format_has_i
-                     : !am_server && log_format_has_i;
+       int itemizing = am_server ? logfile_format_has_i : log_format_has_i;
        int max_phase = protocol_version >= 29 ? 2 : 1;
        int i, recv_ok;
 
@@ -617,9 +615,14 @@ int recv_files(int f_in, struct file_list *flist, char *local_name)
                }
 
                if ((recv_ok && (!delay_updates || !partialptr)) || inplace) {
-                       if (partialptr == fname || *partial_dir == '/')
-                               partialptr = NULL;
-                       finish_transfer(fname, fnametmp, partialptr,
+                       char *temp_copy_name;
+                       if (partialptr == fname)
+                               partialptr = temp_copy_name = NULL;
+                       else if (*partial_dir == '/')
+                               temp_copy_name = NULL;
+                       else
+                               temp_copy_name = partialptr;
+                       finish_transfer(fname, fnametmp, temp_copy_name,
                                        file, recv_ok, 1);
                        if (fnamecmp == partialptr) {
                                do_unlink(partialptr);