load plugin: Set the hostname to something meaningfull, not `localhost'.
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 13 Jan 2007 17:23:15 +0000 (18:23 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 13 Jan 2007 17:23:15 +0000 (18:23 +0100)
src/load.c

index bff629d..e715dcf 100644 (file)
@@ -68,7 +68,14 @@ static void load_submit (double snum, double mnum, double lnum)
 
        vl.values = values;
        vl.values_len = 3;
-       strcpy (vl.host, "localhost"); /* FIXME */
+       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.plugin, "load");
        strcpy (vl.plugin_instance, "");
        strcpy (vl.type_instance, "");