mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-08-03 17:59:07 -04:00
32 lines
1010 B
Plaintext
32 lines
1010 B
Plaintext
$NetBSD: patch-ac,v 1.1 2007/03/17 08:45:06 obache Exp $
|
|
|
|
Index: spl_modules/mod_uuidgen.c
|
|
===================================================================
|
|
--- spl_modules/mod_uuidgen.c.orig 2006-10-25 08:58:24.000000000 +0000
|
|
+++ spl_modules/mod_uuidgen.c
|
|
@@ -40,16 +40,22 @@ extern void SPL_ABI(spl_mod_uuidgen_done
|
|
|
|
/**
|
|
* This function generates a UUID (using libuuid) and returns a 36
|
|
- * character string with a hex representation of th uuid.
|
|
+ * character string with a hex representation of the uuid.
|
|
*/
|
|
// builtin uuidgen()
|
|
static struct spl_node *handler_uuidgen(struct spl_task *task UNUSED, void *data UNUSED)
|
|
{
|
|
uuid_t my_uuid;
|
|
+#if USEBSDAPI
|
|
+ char* my_uuid_string;
|
|
+ uint32_t status;
|
|
+ uuid_create(&my_uuid,&status);
|
|
+ uuid_to_string(&my_uuid,&my_uuid_string,&status);
|
|
+#else
|
|
char my_uuid_string[64];
|
|
-
|
|
uuid_generate(my_uuid);
|
|
uuid_unparse(my_uuid, my_uuid_string);
|
|
+#endif
|
|
|
|
for (int i=0; my_uuid_string[i]; i++)
|
|
if (my_uuid_string[i] >= 'A' && my_uuid_string[i] <= 'Z')
|