1 /*****************************************************************************
2 * RRDtool 1.2.99907080300 Copyright by Tobi Oetiker, 1997-2007
3 * This file: Copyright 2003 Peter Stamfest <peter@stamfest.at>
5 * Distributed under the GPL
6 *****************************************************************************
7 * rrd_not_thread_safe.c Contains routines used when thread safety is not
9 *****************************************************************************
11 *************************************************************************** */
17 static char rrd_error[MAXLEN + 10];
18 static char rrd_liberror[ERRBUFLEN + 10];
19 static int rrd_context_init = 0;
21 /* The global context is very useful in the transition period to even
22 more thread-safe stuff, it can be used whereever we need a context
23 and do not need to worry about concurrency. */
24 static struct rrd_context global_ctx = {
31 /* #include <stdarg.h> */
33 struct rrd_context *rrd_get_context(
36 if (!rrd_context_init) {
38 global_ctx.rrd_error[0] = '\0';
39 global_ctx.lib_errstr[0] = '\0';
44 /* how ugly that is!!! - make sure strerror is what it should be. It
45 might be redefined to help in keeping other modules thread safe by
46 silently turning misplaced strerror into rrd_strerror, but here
47 this turns recursive! */
49 const char *rrd_strerror(