xfs
[Top] [All Lists]

[PATCH 07/14] xfsprogs: uuid changes for OS X

To: xfs@xxxxxxxxxxx
Subject: [PATCH 07/14] xfsprogs: uuid changes for OS X
From: Jan Tulak <jtulak@xxxxxxxxxx>
Date: Tue, 15 Sep 2015 11:59:17 +0200
Cc: Jan Tulak <jtulak@xxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1442311164-12921-1-git-send-email-jtulak@xxxxxxxxxx>
References: <1442311164-12921-1-git-send-email-jtulak@xxxxxxxxxx>
UUID API changed in OS X in last few years, so fix the platform_ calls.

Signed-off-by: Jan Tulak <jtulak@xxxxxxxxxx>
Reviewed-by: Christoph Hellwig <hch@xxxxxx>
---
 include/darwin.h | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/include/darwin.h b/include/darwin.h
index fe489a6..78f7df3 100644
--- a/include/darwin.h
+++ b/include/darwin.h
@@ -81,45 +81,37 @@ static __inline__ void platform_getoptreset(void)
 
 static __inline__ int platform_uuid_compare(uuid_t *uu1, uuid_t *uu2)
 {
-       return uuid_compare(uu1, uu2, NULL);
+       return uuid_compare(*uu1, *uu2);
 }
 
 static __inline__ void platform_uuid_unparse(uuid_t *uu, char *buffer)
 {
-       uint32_t status;
-       char *s;
-       uuid_to_string(uu, &s, &status);
-       if (status == uuid_s_ok)
-               strcpy(buffer, s);
-       else buffer[0] = '\0';
-       free(s);
+       uuid_unparse(*uu, buffer);
 }
 
 static __inline__ int platform_uuid_parse(char *buffer, uuid_t *uu)
 {
-       uint32_t status;
-       uuid_from_string(buffer, uu, &status);
-       return (status == uuid_s_ok);
+       return uuid_parse(buffer, *uu);
 }
 
 static __inline__ int platform_uuid_is_null(uuid_t *uu)
 {
-       return uuid_is_nil(uu, NULL);
+       return uuid_is_null(*uu);
 }
 
 static __inline__ void platform_uuid_generate(uuid_t *uu)
 {
-       uuid_create(uu, NULL);
+       uuid_generate(*uu);
 }
 
 static __inline__ void platform_uuid_clear(uuid_t *uu)
 {
-       uuid_create_nil(uu, NULL);
+       uuid_clear(*uu);
 }
 
 static __inline__ void platform_uuid_copy(uuid_t *dst, uuid_t *src)
 {
-       memcpy(dst, src, sizeof(uuid_t));
+       uuid_copy(*dst, *src);
 }
 
 typedef unsigned char          __u8;
-- 
2.4.3

<Prev in Thread] Current Thread [Next in Thread>