src/plugin.[ch]: Store the hostname in a global variable to minimize calls to `gethos...
[collectd.git] / src / load.c
index 2cc761b..3e60a43 100644 (file)
@@ -69,13 +69,7 @@ static void load_submit (double snum, double mnum, double lnum)
        vl.values = values;
        vl.values_len = 3;
        vl.time = time (NULL);
-       /* FIXME: do this globally */
-       if (gethostname (vl.host, sizeof (vl.host)) != 0)
-       {
-               syslog (LOG_ERR, "load plugin: gethostname failed: %s",
-                               strerror (errno));
-               return;
-       }
+       strcpy (vl.host, hostname);
        strcpy (vl.plugin, "load");
        strcpy (vl.plugin_instance, "");
        strcpy (vl.type_instance, "");