]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
Make sure that we don't try to use iconv() without iconv.h.
authorWayne Davison <wayned@samba.org>
Sun, 5 Feb 2006 04:52:11 +0000 (04:52 +0000)
committerWayne Davison <wayned@samba.org>
Sun, 5 Feb 2006 04:52:11 +0000 (04:52 +0000)
log.c
main.c
rsync.c

diff --git a/log.c b/log.c
index 152430cde3881325cf4da58f8c5bd718f6cb33be..91b57d4374d838572daa619e144bbab84de38dc4 100644 (file)
--- a/log.c
+++ b/log.c
@@ -46,7 +46,7 @@ extern int log_format_has_o_or_i;
 extern int daemon_log_format_has_o_or_i;
 extern char *auth_user;
 extern char *log_format;
-#ifdef HAVE_ICONV_OPEN
+#if defined HAVE_ICONV_OPEN && defined HAVE_ICONV_H
 extern iconv_t ic_chck;
 #endif
 
@@ -204,7 +204,7 @@ static void filtered_fwrite(const char *buf, int len, FILE *f)
                  && isdigit(*(uchar*)(s+2))
                  && isdigit(*(uchar*)(s+3))
                  && isdigit(*(uchar*)(s+4)))
-#ifdef HAVE_ICONV_OPEN
+#if defined HAVE_ICONV_OPEN && defined HAVE_ICONV_H
                 || (*(uchar*)s < ' ' && *s != '\t')
 #else
                 || ((!isprint(*(uchar*)s) || *(uchar*)s < ' ') && *s != '\t')
@@ -298,7 +298,7 @@ void rwrite(enum logcode code, char *buf, int len)
        trailing_CR_or_NL = len && (buf[len-1] == '\n' || buf[len-1] == '\r')
                          ? buf[--len] : 0;
 
-#ifdef HAVE_ICONV_OPEN
+#if defined HAVE_ICONV_OPEN && defined HAVE_ICONV_H
        if (ic_chck != (iconv_t)-1) {
                char convbuf[1024];
                char *in_buf = buf, *out_buf = convbuf;
diff --git a/main.c b/main.c
index 0ba67f8427e47b7fdff252cba5e227e5d9d5c250..e8b5efd39daab5e580e833c1ad098d6449a3db0f 100644 (file)
--- a/main.c
+++ b/main.c
@@ -792,7 +792,7 @@ void start_server(int f_in, int f_out, int argc, char *argv[])
 
        io_set_sock_fds(f_in, f_out);
        setup_protocol(f_out, f_in);
-#ifdef HAVE_ICONV_OPEN
+#if defined HAVE_ICONV_OPEN && defined HAVE_ICONV_H
        setup_iconv();
 #endif
 
@@ -831,7 +831,7 @@ int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[])
 
        io_set_sock_fds(f_in, f_out);
        setup_protocol(f_out,f_in);
-#ifdef HAVE_ICONV_OPEN
+#if defined HAVE_ICONV_OPEN && defined HAVE_ICONV_H
        setup_iconv();
 #endif
 
diff --git a/rsync.c b/rsync.c
index 2a2505a013d4861f67c455789a18d1b8ec829117..ee2f72b671f559f7ac4b3ecb7bc7e18ad7aba8bc 100644 (file)
--- a/rsync.c
+++ b/rsync.c
@@ -50,7 +50,7 @@ extern int keep_dirlinks;
 extern int make_backups;
 extern struct stats stats;
 
-#ifdef HAVE_ICONV_OPEN
+#if defined HAVE_ICONV_OPEN && defined HAVE_ICONV_H
 iconv_t ic_chck = (iconv_t)-1;
 
 static char *default_charset(void)