Made the UNUSED(parameter) macro calls read a little nicer.
[rsync/rsync.git] / main.c
diff --git a/main.c b/main.c
index e9670ef..810576f 100644 (file)
--- a/main.c
+++ b/main.c
@@ -85,10 +85,9 @@ static void report(int f)
        extern int remote_version;
        int send_stats;
 
-       if (do_stats) {
+       if (do_stats && verbose > 1) {
                /* These come out from every process */
-               if (verbose > 1)
-                       show_malloc_stats();
+               show_malloc_stats();
                show_flist_stats();
        }
 
@@ -286,6 +285,7 @@ oom:
 static char *get_local_name(struct file_list *flist,char *name)
 {
        STRUCT_STAT st;
+       int e;
        extern int orig_umask;
 
        if (verbose > 2)
@@ -311,7 +311,7 @@ static char *get_local_name(struct file_list *flist,char *name)
                return name;
        }
 
-       if (flist->count <= 1)
+       if (flist->count <= 1 && ((e = strlen(name)) <= 1 || name[e-1] != '/'))
                return name;
 
        if (do_mkdir(name,0777 & ~orig_umask) != 0) {
@@ -877,17 +877,20 @@ static int start_client(int argc, char *argv[])
 }
 
 
-static RETSIGTYPE sigusr1_handler(int UNUSED(val)) {
+static RETSIGTYPE sigusr1_handler(UNUSED(int val))
+{
        exit_cleanup(RERR_SIGNAL);
 }
 
-static RETSIGTYPE sigusr2_handler(int UNUSED(val)) {
+static RETSIGTYPE sigusr2_handler(UNUSED(int val))
+{
        extern int log_got_error;
        if (log_got_error) _exit(RERR_PARTIAL);
        _exit(0);
 }
 
-static RETSIGTYPE sigchld_handler(int UNUSED(val)) {
+static RETSIGTYPE sigchld_handler(UNUSED(int val))
+{
 #ifdef WNOHANG
        int cnt, status;
        pid_t pid;
@@ -945,7 +948,7 @@ const char *get_panic_action(void)
  * should just look at the environment variable, but I'm a bit leery
  * of a signal sending us into a busy loop.
  **/
-static RETSIGTYPE rsync_panic_handler(int UNUSED(whatsig))
+static RETSIGTYPE rsync_panic_handler(UNUSED(int whatsig))
 {
        char cmd_buf[300];
        int ret;
@@ -1056,6 +1059,5 @@ int main(int argc,char *argv[])
        else
                exit_cleanup(ret);
 
-       exit(ret);
-       /* NOTREACHED */
+       return ret;
 }