summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2004-01-27 23:13:13 +0000
committerWayne Davison <wayned@samba.org>2004-01-27 23:13:13 +0000
commitc3e5e5851be229b46440ca5660dff0ae2b526455 (patch)
treeccf3100943280dbc06e111e5621ffafbe355be0c
parent4337c8f856340f398695811ddaa5c6f8d005379f (diff)
downloadrsync-c3e5e5851be229b46440ca5660dff0ae2b526455.tar.gz
New function: who_am_i() returns "sender", "receiver", or "generator".
-rw-r--r--rsync.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/rsync.c b/rsync.c
index 3c1115f7..df52b698 100644
--- a/rsync.c
+++ b/rsync.c
@@ -26,6 +26,9 @@ extern int verbose;
extern int dry_run;
extern int preserve_times;
extern int am_root;
+extern int am_server;
+extern int am_sender;
+extern int am_generator;
extern int preserve_uid;
extern int preserve_gid;
extern int preserve_perms;
@@ -240,3 +243,8 @@ void finish_transfer(char *fname, char *fnametmp, struct file_struct *file)
set_perms(fname,file,NULL,0);
}
}
+
+const char *who_am_i(void)
+{
+ return am_sender ? "sender" : am_generator ? "generator" : "receiver";
+}