summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 69a2285)
raw | patch | inline | side by side (parent: 69a2285)
author | Sean Campbell <campbellsean@campbellsean-cloudtop.c.googlers.com> | |
Wed, 11 Oct 2017 21:50:56 +0000 (17:50 -0400) | ||
committer | Sean Campbell <campbellsean@campbellsean-cloudtop.c.googlers.com> | |
Wed, 11 Oct 2017 21:50:56 +0000 (17:50 -0400) |
src/daemon/globals.c | patch | blob | history | |
src/perl.c | patch | blob | history |
diff --git a/src/daemon/globals.c b/src/daemon/globals.c
index 2222a5ce8b9e8f53e69319324219c3a35fa3212d..9b0aec739997c1af2419a021b87df8e57e311615 100644 (file)
--- a/src/daemon/globals.c
+++ b/src/daemon/globals.c
#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
*/
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;
+}
+
diff --git a/src/perl.c b/src/perl.c
index d2a00bfde5ec316e2482bbf7deb1148a7a13dac2..9268086fd8e82c11848e7ad009b8bc8b8ce8a27c 100644 (file)
--- a/src/perl.c
+++ b/src/perl.c
{"Collectd::NOTIF_WARNING", NOTIF_WARNING},
{"Collectd::NOTIF_OKAY", NOTIF_OKAY},
{"", 0}};
-
-struct {
- char name[64];
- char *var;
-} g_strings[] = {{"Collectd::hostname_g", hostname_g}, {"", NULL}};
-
/*
* Helper functions for data type conversion.
*/
* accessing any such variable (this is basically the same as using
* tie() in Perl) */
/* global strings */
+ struct {
+ char name[64];
+ char *var;
+ } g_strings[] = {{"Collectd::hostname_g", hostname_g}, {"", NULL}};
+
for (int i = 0; '\0' != g_strings[i].name[0]; ++i) {
tmp = get_sv(g_strings[i].name, 1);
sv_magicext(tmp, NULL, PERL_MAGIC_ext, &g_pv_vtbl, g_strings[i].var, 0);