From: Wayne Davison Date: Wed, 10 Oct 2007 19:24:35 +0000 (+0000) Subject: Conditionalize the call to setup_iconv(). X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/44c4492acfc8ff6c48b5848c2a34acd6be50dddb Conditionalize the call to setup_iconv(). --- diff --git a/main.c b/main.c index df0b6e8a..154ddde7 100644 --- a/main.c +++ b/main.c @@ -448,16 +448,22 @@ static pid_t do_cmd(char *cmd, char *machine, char *user, char **remote_argv, in *f_out_p = from_gen_pipe[1]; *f_in_p = batch_fd; ret = -1; /* no child pid */ +#ifdef ICONV_CONST setup_iconv(); +#endif } else if (local_server) { /* If the user didn't request --[no-]whole-file, force * it on, but only if we're not batch processing. */ if (whole_file < 0 && !write_batch) whole_file = 1; ret = local_child(argc, args, f_in_p, f_out_p, child_main); +#ifdef ICONV_CONST setup_iconv(); +#endif } else { +#ifdef ICONV_CONST setup_iconv(); +#endif if (protect_args) { int fd; #ifdef ICONV_OPTION @@ -1479,9 +1485,11 @@ int main(int argc,char *argv[]) if (write_batch < 0) dry_run = 1; - if (am_server) + if (am_server) { +#ifdef ICONV_CONST setup_iconv(); - else if (am_daemon) +#endif + } else if (am_daemon) return daemon_main(); if (am_server && protect_args) { diff --git a/pipe.c b/pipe.c index f3cea83f..12aa73d7 100644 --- a/pipe.c +++ b/pipe.c @@ -144,7 +144,9 @@ pid_t local_child(int argc, char **argv, int *f_in, int *f_out, close(to_child_pipe[0]); if (from_child_pipe[1] != STDOUT_FILENO) close(from_child_pipe[1]); +#ifdef ICONV_CONST setup_iconv(); +#endif child_main(argc, argv); }