Make g_strings in perl.c not global so that hostname_g as a char* doesn't break it.x
[collectd.git] / src / daemon / globals.c
index 2222a5c..9b0aec7 100644 (file)
 #include <kstat.h>
 #endif
 
-void hostname_set(char const *hostname) {
-  char *h = strdup(hostname);
-  if (h == NULL)
-    return;
-
-  free(hostname_g);
-  hostname_g = h;
-}
-
 /*
  * Global variables
  */
@@ -47,3 +38,12 @@ int  timeout_g;
 kstat_ctl_t *kc;
 #endif
 
+void hostname_set(char const *hostname) {
+    char *h = strdup(hostname);
+      if (h == NULL)
+            return;
+
+        free(hostname_g);
+          hostname_g = h;
+}
+