blob: 2d8485cccbdb3f1ac47d22c5d539c3178e08e18d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
$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')
|