aboutsummaryrefslogtreecommitdiffstats
path: root/clientserver.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2011-06-04 12:12:25 -0700
committerWayne Davison <wayned@samba.org>2011-06-04 12:12:49 -0700
commitd80f7d6cc30764be74e5eb48259344ef868e38b7 (patch)
treef8b0ceda54449386aaba12bd09c3f52c292b2491 /clientserver.c
parente3bc529de9b7d0e98c492677f73a8127a1d74d35 (diff)
downloadandroid_external_rsync-d80f7d6cc30764be74e5eb48259344ef868e38b7.tar.gz
android_external_rsync-d80f7d6cc30764be74e5eb48259344ef868e38b7.tar.bz2
android_external_rsync-d80f7d6cc30764be74e5eb48259344ef868e38b7.zip
Add a colon if a non-empty pre-xfer exec message follows.
Diffstat (limited to 'clientserver.c')
-rw-r--r--clientserver.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/clientserver.c b/clientserver.c
index 91612ea0..fbd3af65 100644
--- a/clientserver.c
+++ b/clientserver.c
@@ -396,9 +396,10 @@ static char *finish_pre_exec(pid_t pid, int write_fd, int read_fd, char *request
if (wait_process(pid, &status, 0) < 0
|| !WIFEXITED(status) || WEXITSTATUS(status) != 0) {
char *e;
- if (asprintf(&e, "pre-xfer exec returned failure (%d)%s%s\n%s",
+ if (asprintf(&e, "pre-xfer exec returned failure (%d)%s%s%s\n%s",
status, status < 0 ? ": " : "",
- status < 0 ? strerror(errno) : "", buf) < 0)
+ status < 0 ? strerror(errno) : "",
+ *buf ? ":" : "", buf) < 0)
return "out_of_memory in finish_pre_exec\n";
return e;
}