rrdtool plugin: Make sure the initialization is run only once.
authorFlorian Forster <octo@huhu.verplant.org>
Mon, 18 May 2009 12:42:39 +0000 (14:42 +0200)
committerFlorian Forster <octo@huhu.verplant.org>
Mon, 18 May 2009 12:42:39 +0000 (14:42 +0200)
Thanks to Amit Gupta for reporting this bug!

src/rrdtool.c

index bbebc37..a205ef2 100644 (file)
@@ -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)