Changed who_am_i() to output "server" or "client" when am_sender
authorWayne Davison <wayned@samba.org>
Tue, 1 Feb 2005 09:45:09 +0000 (09:45 +0000)
committerWayne Davison <wayned@samba.org>
Tue, 1 Feb 2005 09:45:09 +0000 (09:45 +0000)
is negative.  This will only occur during the startup phase
before we know if we're the sender or not (e.g. when parsing
client-side --filter/--exclude/--include options).

rsync.c

diff --git a/rsync.c b/rsync.c
index acb260cc97424461ce2d40ae1f5c3dbc53a0558e..537df0a1e30711af74d7a7f2106f6239e24ad2eb 100644 (file)
--- a/rsync.c
+++ b/rsync.c
@@ -27,6 +27,7 @@ extern int dry_run;
 extern int preserve_times;
 extern int omit_dir_times;
 extern int am_root;
+extern int am_server;
 extern int am_sender;
 extern int am_generator;
 extern int preserve_uid;
@@ -299,5 +300,7 @@ void finish_transfer(char *fname, char *fnametmp, struct file_struct *file,
 
 const char *who_am_i(void)
 {
+       if (am_sender < 0)
+               return am_server ? "server" : "client";
        return am_sender ? "sender" : am_generator ? "generator" : "receiver";
 }