From 48fb6edebc0e55ad793c40eff8b7a1e7880c9ca8 Mon Sep 17 00:00:00 2001 From: oetiker Date: Tue, 9 Apr 2002 21:34:13 +0000 Subject: [PATCH] added tzset and setlocale to rrd_graph git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@120 a5681a0c-68f1-0310-ab6d-d61299d08faa --- configure.ac | 4 ++-- src/rrd_graph.c | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index a9d8726..d6557f5 100644 --- a/configure.ac +++ b/configure.ac @@ -230,7 +230,7 @@ AC_PROG_LIBTOOL dnl Checks for header files. AC_HEADER_STDC -AC_CHECK_HEADERS(fcntl.h fp_class.h malloc.h unistd.h ieeefp.h math.h sys/time.h sys/times.h sys/param.h sys/resource.h float.h) +AC_CHECK_HEADERS(fcntl.h time.h locale.h fp_class.h malloc.h unistd.h ieeefp.h math.h sys/time.h sys/times.h sys/param.h sys/resource.h float.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST @@ -278,7 +278,7 @@ AC_FUNC_VPRINTF dnl for each function found we get a definition in config.h dnl of the form HAVE_FUNCTION -AC_CHECK_FUNCS(strerror snprintf vsnprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday) +AC_CHECK_FUNCS(tzset setlocale strerror snprintf vsnprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday) dnl HP-UX 11.00 does not have finite but does have isfinite as a macro AC_CHECK_FUNCS(fpclassify, , diff --git a/src/rrd_graph.c b/src/rrd_graph.c index cc2861f..c58326f 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -13,6 +13,12 @@ #include #include #endif +#ifdef HAVE_TIME_H +#include +#endif +#ifdef HAVE_LOCALE_H +#include +#endif #include "rrd_graph.h" #include "rrd_graph_helper.h" @@ -2434,6 +2440,14 @@ rrd_graph(int argc, char **argv, char ***prdata, int *xsize, int *ysize) { image_desc_t im; +#ifdef HAVE_TZSET + tzset(); +#endif +#ifdef HAVE_SETLOCALE + setlocale(LC_ALL,""); +#endif + + rrd_graph_init(&im); rrd_graph_options(argc,argv,&im); -- 2.30.2