Changed print_child_argv() to take its prefix message as an arg.
authorWayne Davison <wayned@samba.org>
Sun, 16 Sep 2007 21:41:42 +0000 (21:41 +0000)
committerWayne Davison <wayned@samba.org>
Sun, 16 Sep 2007 21:41:42 +0000 (21:41 +0000)
clientserver.c
pipe.c
util.c

index d34f2b252692fc020508d7def0e6ded89d120f4c..d16e5617dfab25a666ee7058bc2ee4b1b2baa4fd 100644 (file)
@@ -242,7 +242,7 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char
        sargs[sargc] = NULL;
 
        if (verbose > 1)
-               print_child_argv(sargs);
+               print_child_argv("sending daemon args:", sargs);
 
        p = strchr(path, '/');
        if (p) *p = '\0';
diff --git a/pipe.c b/pipe.c
index 4508478c6f8613671d468600b64f35eb4b195b0c..50c78c427f85dfd55e40a34cb3342826cbf1f8b3 100644 (file)
--- a/pipe.c
+++ b/pipe.c
@@ -50,7 +50,7 @@ pid_t piped_child(char **command, int *f_in, int *f_out)
        int from_child_pipe[2];
 
        if (verbose >= 2)
-               print_child_argv(command);
+               print_child_argv("opening connection using:", command);
 
        if (fd_pair(to_child_pipe) < 0 || fd_pair(from_child_pipe) < 0) {
                rsyserr(FERROR, errno, "pipe");
diff --git a/util.c b/util.c
index 1fc3106965949915abd18348d2a315ab71350867..b309a8da18988c66c9922c43dfe031b13972303b 100644 (file)
--- a/util.c
+++ b/util.c
@@ -90,9 +90,9 @@ int fd_pair(int fd[2])
        return ret;
 }
 
-void print_child_argv(char **cmd)
+void print_child_argv(const char *prefix, char **cmd)
 {
-       rprintf(FCLIENT, "opening connection using ");
+       rprintf(FCLIENT, "%s ", prefix);
        for (; *cmd; cmd++) {
                /* Look for characters that ought to be quoted.  This
                * is not a great quoting algorithm, but it's
@@ -1478,7 +1478,7 @@ void *expand_item_list(item_list *lp, size_t item_size,
                void *new_ptr;
                size_t new_size = lp->malloced;
                if (incr < 0)
-                       new_size -= incr; /* increase slowly */
+                       new_size += -incr; /* increase slowly */
                else if (new_size < (size_t)incr)
                        new_size += incr;
                else