From: oetiker Date: Tue, 27 Oct 2009 16:18:43 +0000 (+0000) Subject: remove HAVE_LOCALE_H and HAVE_TIME_H and HAVE_SETLOCALE since they have not been... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4dca5ee2d9ec2f43fec94911b5c4c00930051229;p=rrdtool.git remove HAVE_LOCALE_H and HAVE_TIME_H and HAVE_SETLOCALE since they have not been used consistantly anyway git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1953 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/configure.ac b/configure.ac index c5fe57d..f21892f 100644 --- a/configure.ac +++ b/configure.ac @@ -182,7 +182,7 @@ CONFIGURE_PART(Checking for Header Files) dnl Checks for header files. AC_HEADER_STDC AC_HEADER_DIRENT -AC_CHECK_HEADERS(stdint.h inttypes.h libgen.h features.h sys/stat.h sys/types.h fcntl.h locale.h fp_class.h malloc.h unistd.h ieeefp.h math.h time.h sys/times.h sys/param.h sys/resource.h signal.h float.h stdio.h stdlib.h errno.h string.h ctype.h) +AC_CHECK_HEADERS(stdint.h inttypes.h libgen.h features.h sys/stat.h sys/types.h fcntl.h fp_class.h malloc.h unistd.h ieeefp.h math.h sys/times.h sys/param.h sys/resource.h signal.h float.h stdio.h stdlib.h errno.h string.h ctype.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST @@ -209,7 +209,7 @@ AC_C_BIGENDIAN dnl for each function found we get a definition in config.h dnl of the form HAVE_FUNCTION -AC_CHECK_FUNCS(tzset fsync mbstowcs opendir readdir chdir chroot getuid setlocale strerror snprintf vsnprintf vasprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday) +AC_CHECK_FUNCS(tzset fsync mbstowcs opendir readdir chdir chroot getuid strerror snprintf vsnprintf vasprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday) AC_FUNC_STRERROR_R diff --git a/src/rrd_dump.c b/src/rrd_dump.c index 57bd0b8..3b7867f 100644 --- a/src/rrd_dump.c +++ b/src/rrd_dump.c @@ -45,9 +45,7 @@ #include "rrd_rpncalc.h" #include "rrd_client.h" -#ifdef HAVE_LOCALE_H #include -#endif #if !(defined(NETWARE) || defined(WIN32)) extern char *tzname[2]; @@ -105,9 +103,8 @@ int rrd_dump_cb_r( return (-1); } -#ifdef HAVE_SETLOCALE old_locale = setlocale(LC_NUMERIC, "C"); -#endif + if (opt_header == 1) { CB_PUTS("\n"); @@ -451,9 +448,7 @@ int rrd_dump_cb_r( rrd_free(&rrd); -#ifdef HAVE_SETLOCALE setlocale(LC_NUMERIC, old_locale); -#endif return rrd_close(rrd_file); diff --git a/src/rrd_graph.c b/src/rrd_graph.c index b1cb663..d3aa626 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -25,13 +25,9 @@ #include #endif -#ifdef HAVE_TIME_H #include -#endif -#ifdef HAVE_LOCALE_H #include -#endif #include "rrd_graph.h" #include "rrd_client.h" diff --git a/src/rrd_restore.c b/src/rrd_restore.c index fc6f17b..d75247d 100644 --- a/src/rrd_restore.c +++ b/src/rrd_restore.c @@ -1256,15 +1256,11 @@ int rrd_restore( return (-1); } -#ifdef HAVE_SETLOCALE old_locale = setlocale(LC_NUMERIC, "C"); -#endif rrd = parse_file(argv[optind]); -#ifdef HAVE_SETLOCALE setlocale(LC_NUMERIC, old_locale); -#endif if (rrd == NULL) return (-1); diff --git a/src/rrd_tool.c b/src/rrd_tool.c index 7464b3c..302669d 100644 --- a/src/rrd_tool.c +++ b/src/rrd_tool.c @@ -18,9 +18,8 @@ #include "rrd_xport.h" #include "rrd_i18n.h" -#ifdef HAVE_LOCALE_H #include -#endif + void PrintUsage( char *cmd); @@ -408,11 +407,10 @@ int main( #ifdef MUST_DISABLE_FPMASK fpsetmask(0); #endif -#ifdef HAVE_LOCALE_H + /* initialize locale settings according to localeconv(3) */ setlocale(LC_ALL, ""); -#endif #if defined(HAVE_LIBINTL_H) && defined(BUILD_LIBINTL) bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);