Merge branch 'collectd-4.5' into collectd-4.6
[collectd.git] / src / mysql.c
index 323154f..1c009a0 100644 (file)
@@ -125,7 +125,7 @@ static int config (const char *key, const char *value)
            int temp;
 
            errno = 0;
-           temp = strtol (value, $endptr, 0);
+           temp = strtol (value, &endptr, 0);
            if ((errno != 0) || (value == endptr))
            {
                ERROR ("mysql plugin: Invalid \"Port\" argument: %s",
@@ -142,6 +142,7 @@ static int config (const char *key, const char *value)
            }
 
            port = temp;
+           return (0);
        }
        else
                return (-1);
@@ -157,7 +158,6 @@ static void counter_submit (const char *type, const char *type_instance,
 
        vl.values = values;
        vl.values_len = 1;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "mysql", sizeof (vl.plugin));
        sstrncpy (vl.type, type, sizeof (vl.type));
@@ -181,7 +181,6 @@ static void qcache_submit (counter_t hits, counter_t inserts,
 
        vl.values = values;
        vl.values_len = 5;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "mysql", sizeof (vl.plugin));
        sstrncpy (vl.type, "mysql_qcache", sizeof (vl.type));
@@ -202,7 +201,6 @@ static void threads_submit (gauge_t running, gauge_t connected, gauge_t cached,
 
        vl.values = values;
        vl.values_len = 4;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "mysql", sizeof (vl.plugin));
        sstrncpy (vl.type, "mysql_threads", sizeof (vl.type));
@@ -220,7 +218,6 @@ static void traffic_submit (counter_t rx, counter_t tx)
 
        vl.values = values;
        vl.values_len = 2;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "mysql", sizeof (vl.plugin));
        sstrncpy (vl.type, "mysql_octets", sizeof (vl.type));