Added maybe_log_item() for use by the sender and receiver.
authorWayne Davison <wayned@samba.org>
Fri, 4 Mar 2005 16:52:00 +0000 (16:52 +0000)
committerWayne Davison <wayned@samba.org>
Fri, 4 Mar 2005 16:52:00 +0000 (16:52 +0000)
log.c

diff --git a/log.c b/log.c
index 652bc06..b45fd8d 100644 (file)
--- a/log.c
+++ b/log.c
@@ -521,6 +521,18 @@ void log_item(struct file_struct *file, struct stats *initial_stats,
        }
 }
 
+void maybe_log_item(struct file_struct *file, int iflags, int itemizing,
+                   char *buf)
+{
+       int see_item = itemizing && (iflags || verbose > 1);
+       if (am_server) {
+               if (am_daemon && !dry_run && see_item)
+                       log_item(file, &stats, iflags, buf);
+       } else if (see_item || iflags & ITEM_UPDATING || *buf
+           || (S_ISDIR(file->mode) && iflags & ITEM_REPORT_TIME))
+               log_item(file, &stats, iflags, buf);
+}
+
 void log_delete(char *fname, int mode)
 {
        static struct file_struct file;