From 92811dfcb772a4613b0938b010869cab536acc3e Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Fri, 25 Dec 2015 11:19:29 +0100 Subject: [PATCH] uuid plugin: make it work on NetBSD --- src/uuid.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/uuid.c b/src/uuid.c index 816e624a..a607d619 100644 --- a/src/uuid.c +++ b/src/uuid.c @@ -114,7 +114,7 @@ uuid_get_from_dmidecode(void) return (uuid); } -#if defined(__APPLE__) || defined(__FreeBSD__) +#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) static char * uuid_get_from_sysctlbyname(const char *name) { @@ -215,6 +215,9 @@ uuid_get_local(void) #elif defined(__FreeBSD__) if ((uuid = uuid_get_from_sysctlbyname("kern.hostuuid")) != NULL) return (uuid); +#elif defined(__NetBSD__) + if ((uuid = uuid_get_from_sysctlbyname("machdep.dmi.system-uuid")) != NULL) + return (uuid); #elif defined(__linux__) if ((uuid = uuid_get_from_file("/sys/class/dmi/id/product_uuid")) != NULL) return (uuid); -- 2.30.2