From: Florian Forster Date: Mon, 18 May 2009 12:42:39 +0000 (+0200) Subject: rrdtool plugin: Make sure the initialization is run only once. X-Git-Tag: collectd-4.6.3~10 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f331f9975e8d90a8c430ee7c739c4c3ed8bbb1ec;p=collectd.git rrdtool plugin: Make sure the initialization is run only once. Thanks to Amit Gupta for reporting this bug! --- diff --git a/src/rrdtool.c b/src/rrdtool.c index bbebc375..a205ef2c 100644 --- a/src/rrdtool.c +++ b/src/rrdtool.c @@ -1007,8 +1007,13 @@ static int rrd_shutdown (void) static int rrd_init (void) { + static int init_once = 0; int status; + if (init_once != 0) + return (0); + init_once = 1; + if (rrdcreate_config.stepsize < 0) rrdcreate_config.stepsize = 0; if (rrdcreate_config.heartbeat <= 0)