X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fuuid.c;h=a5fba034faf22f518f496deb5125a10bb8a24f8b;hp=1cb902708239e6e5532d1ab46ece44440550eb79;hb=f22b9ecc5e5d204e5dcb6861d6fd8039e1fb0181;hpb=5a32acd88719481cc22aaecd36f3cbc11f3a3489 diff --git a/src/uuid.c b/src/uuid.c index 1cb90270..a5fba034 100644 --- a/src/uuid.c +++ b/src/uuid.c @@ -26,10 +26,12 @@ #include "collectd.h" -#include "common.h" #include "plugin.h" +#include "utils/common/common.h" -#if HAVE_SYS_SYSCTL_H +#if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_SYSCTLBYNAME) || \ + defined(__OpenBSD__) +/* Implies have BSD variant */ #include #endif @@ -37,18 +39,15 @@ #define UUID_PRINTABLE_COMPACT_LENGTH (UUID_RAW_LENGTH * 2) #define UUID_PRINTABLE_NORMAL_LENGTH (UUID_PRINTABLE_COMPACT_LENGTH + 4) -static char *uuidfile = NULL; +static char *uuidfile; static const char *config_keys[] = {"UUIDFile"}; static int looks_like_a_uuid(const char *uuid) { - int len; - if (!uuid) return 0; - len = strlen(uuid); - + size_t len = strlen(uuid); if (len < UUID_PRINTABLE_COMPACT_LENGTH) return 0;