Some PowerPC cross-compilers have the uuid.h header file but not the
uuid library. Hence this patch that causes f2fs-tools only to use the
uuid functions if both the uuid header file and library are available.

Signed-off-by: Bart Van Assche <bvanass...@acm.org>
---
 mkfs/f2fs_format.c | 2 +-
 tools/f2fscrypt.c  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
index ce7d1c9e40bd..60a6b15af8ec 100644
--- a/mkfs/f2fs_format.c
+++ b/mkfs/f2fs_format.c
@@ -22,7 +22,7 @@
 #include <time.h>
 
 #include "config.h"
-#ifdef HAVE_UUID_UUID_H
+#if defined(HAVE_UUID_UUID_H) && defined(HAVE_LIBUUID)
 #include <uuid/uuid.h>
 #else
 #define uuid_parse(a, b) -1
diff --git a/tools/f2fscrypt.c b/tools/f2fscrypt.c
index f2fbf0bf3878..37c791e52e7f 100644
--- a/tools/f2fscrypt.c
+++ b/tools/f2fscrypt.c
@@ -356,7 +356,7 @@ static void parse_salt(char *salt_str, int flags)
                        perror("F2FS_IOC_GET_ENCRYPTION_PWSALT");
                        exit(1);
                }
-#ifdef HAVE_UUID_UUID_H
+#if defined(HAVE_UUID_UUID_H) && defined(HAVE_LIBUUID)
                if (options & OPT_VERBOSE) {
                        char tmp[80];
                        uuid_unparse(buf, tmp);
@@ -384,7 +384,7 @@ static void parse_salt(char *salt_str, int flags)
                                (((unsigned char)(h - hexchars) << 4) +
                                 (unsigned char)(l - hexchars));
                }
-#ifdef HAVE_UUID_UUID_H
+#if defined(HAVE_UUID_UUID_H) && defined(HAVE_LIBUUID)
        } else if (uuid_parse(cp, buf) == 0) {
                salt_len = 16;
 #endif


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to