attempt macOS fix

This commit is contained in:
nhmall
2026-04-25 15:57:36 -04:00
parent 4cf78d8f31
commit 89c7435b7a
+9 -5
View File
@@ -843,11 +843,11 @@ sys_random_seed(void)
void void
get_nhuuid(void) get_nhuuid(void)
{ {
char struuid[37] = { 0 };
#if defined(LINUX) && defined(NHUUID) #if defined(LINUX) && defined(NHUUID)
char struuid[37] = { 0 };
uuid_t binuuid; uuid_t binuuid;
#endif #elif defined(MACOS) && defined(NHUUID)
#if defined(MACOS) && defined(NHUUID) char *struuid = NULL;
extern char *get_mac_uuid(char **); /* sys/unix/macuuid.m */ extern char *get_mac_uuid(char **); /* sys/unix/macuuid.m */
#endif #endif
@@ -855,12 +855,16 @@ get_nhuuid(void)
return; return;
#if defined(MACOS) && defined(NHUUID) #if defined(MACOS) && defined(NHUUID)
get_mac_uuid(&struuid[0]); get_mac_uuid(&struuid);
#elif defined(LINUX) && defined(NHUUID) #elif defined(LINUX) && defined(NHUUID)
uuid_generate_random(binuuid); uuid_generate_random(binuuid);
uuid_unparse(binuuid, struuid); uuid_unparse(binuuid, struuid);
#endif /* MACOS || LINUX */ #endif /* MACOS || LINUX */
Snprintf(svn.nhuuid, sizeof svn.nhuuid, "%s", &struuid[0]); Snprintf(svn.nhuuid, sizeof svn.nhuuid, "%s", struuid);
#if defined(MACOS) && defined(NHUUID)
free_macos_uuid();
#endif
} }
void void