1 /*****************************************************************************
2 * RRDtool 1.2.16 Copyright by Tobi Oetiker, 1997-2006
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;
20 /* The global context is very useful in the transition period to even
21 more thread-safe stuff, it can be used whereever we need a context
22 and do not need to worry about concurrency. */
23 static struct rrd_context global_ctx = {
29 /* #include <stdarg.h> */
31 struct rrd_context *rrd_get_context(void) {
32 if (! rrd_context_init ){
34 global_ctx.rrd_error[0]='\0';
35 global_ctx.lib_errstr[0]='\0';
40 /* how ugly that is!!! - make sure strerror is what it should be. It
41 might be redefined to help in keeping other modules thread safe by
42 silently turning misplaced strerror into rrd_strerror, but here
43 this turns recursive! */
45 const char *rrd_strerror(int err) {