Skip to contentSkip to conversation

f2fscrypt: avoid to fail android build

PATCH New Jaegeuk Kim 1 participant 2 messages Mar 4, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 f2fscrypt: avoid to fail android build

This fixes some static build errors.

---
 include/android_config.h | 4 ----
 tools/f2fscrypt.c        | 8 +++++---
 tools/f2fstat.c          | 2 +-
 3 files changed, 6 insertions(+), 8 deletions(-)
include/android_config.h +0 -4
index 4582887..0613400 100644
@@ -18,13 +18,11 @@
 #define HAVE_SYS_XATTR_H 1
 #define HAVE_UNISTD_H 1
 
-#define HAVE_ADD_KEY 1
 #define HAVE_FALLOCATE 1
 #define HAVE_FSETXATTR 1
 #define HAVE_FSTAT 1
 #define HAVE_FSTAT64 1
 #define HAVE_GETMNTENT 1
-#define HAVE_KEYCTL 1
 #define HAVE_LLSEEK 1
 #define HAVE_LSEEK64 1
 #define HAVE_MEMSET 1
@@ -48,13 +46,11 @@
 #define HAVE_SYS_XATTR_H 1
 #define HAVE_UNISTD_H 1
 
-#define HAVE_ADD_KEY 1
 #define HAVE_FALLOCATE 1
 #define HAVE_FSETXATTR 1
 #define HAVE_FSTAT 1
 #define HAVE_FSTAT64 1
 #define HAVE_GETMNTENT 1
-#define HAVE_KEYCTL 1
 #define HAVE_LLSEEK 1
 #define HAVE_MEMSET 1
 
tools/f2fscrypt.c +5 -3
index 81ef830..fe3e0ff 100644
@@ -275,7 +275,8 @@ static void clear_secrets(void)
 	memset(in_passphrase, 0, sizeof(in_passphrase));
 }
 
-static void die_signal_handler(int signum, siginfo_t *siginfo, void *context)
+static void die_signal_handler(int UNUSED(signum),
+		siginfo_t *UNUSED(siginfo), void *UNUSED(context))
 {
 	clear_secrets();
 	exit(-1);
@@ -837,7 +838,8 @@ static void do_get_policy(int argc, char **argv, const struct cmd_desc *cmd)
 "Give the invoking process (typically a shell) a new session keyring,\n" \
 "discarding its old session keyring.\n"
 
-static void do_new_session(int argc, char **argv, const struct cmd_desc *cmd)
+static void do_new_session(int argc, char **UNUSED(argv),
+					const struct cmd_desc *cmd)
 {
 	long keyid, ret;
 
@@ -872,7 +874,7 @@ const struct cmd_desc cmd_list[] = {
 	{ NULL, NULL, NULL, NULL, 0 }
 };
 
-static void do_help(int argc, char **argv, const struct cmd_desc *cmd)
+static void do_help(int argc, char **argv, const struct cmd_desc *UNUSED(cmd))
 {
 	const struct cmd_desc *p;
 
tools/f2fstat.c +1 -1
index 7f485b0..e0b1677 100644
@@ -81,7 +81,7 @@ void f2fstat(struct options *opt)
 	int ret;
 	char keyname[32];
 	char buf[4096];
-	struct mm_table key = { keyname, NULL };
+	struct mm_table key = { keyname, NULL, 0 };
 	struct mm_table *found;
 	int f2fstat_table_cnt;
 	char *head, *tail;
Signature · 1 line
2.19.0.605.g01d371f741-goog
#1 lore raw

PATCH 2/2 f2fs-tools: add c++ for UNUSED

From: Jaegeuk Kim <[email protected]>

This can avoid build failure for f2fscrypt.

Change-Id I33eddc62eea486dc219c25d089112e011864dd4f
---
 include/f2fs_fs.h       | 2 ++
 tools/f2fs_io/f2fs_io.h | 2 ++
 2 files changed, 4 insertions(+)
include/f2fs_fs.h +2 -0
index a730688..8d1490c 100644
@@ -52,6 +52,8 @@
 # define UNUSED(x) UNUSED_ ## x __attribute__((unused))
 #elif defined(__LCLINT__)
 # define UNUSED(x) x
+#elif defined(__cplusplus)
+# define UNUSED(x)
 #else
 # define UNUSED(x) x
 #endif
tools/f2fs_io/f2fs_io.h +2 -0
index 6b619bd..95fd5be 100644
@@ -17,6 +17,8 @@
 # define UNUSED(x) UNUSED_ ## x __attribute__((unused))
 #elif defined(__LCLINT__)
 # define UNUSED(x) x
+#elif defined(__cplusplus)
+# define UNUSED(x)
 #else
 # define UNUSED(x) x
 #endif
Signature · 1 line
2.19.0.605.g01d371f741-goog