From aee40b870cd70a884fd98a56d9c956945584b429 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sun, 12 Jul 2015 23:09:15 -0400 Subject: [PATCH] Eliminate unused function warnings from Android build Signed-off-by: Theodore Ts'o --- lib/ext2fs/ismounted.c | 2 +- lib/ext2fs/mmp.c | 2 ++ lib/ss/get_readline.c | 4 ++-- lib/uuid/gen_uuid.c | 3 ++- misc/e4crypt.c | 5 ----- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/ext2fs/ismounted.c b/lib/ext2fs/ismounted.c index 6c6ecff..b1eff85 100644 --- a/lib/ext2fs/ismounted.c +++ b/lib/ext2fs/ismounted.c @@ -42,6 +42,7 @@ #include "ext2_fs.h" #include "ext2fs.h" +#ifdef HAVE_SETMNTENT /* * Check to see if a regular file is mounted. * If /etc/mtab/ is a symlink of /proc/mounts, you will need the following check @@ -72,7 +73,6 @@ static int check_loop_mounted(const char *mnt_fsname, dev_t mnt_rdev, return 0; } -#ifdef HAVE_SETMNTENT /* * Helper function which checks a file in /etc/mtab format to see if a * filesystem is mounted. Returns an error if the file doesn't exist diff --git a/lib/ext2fs/mmp.c b/lib/ext2fs/mmp.c index 3947b1f..8d927d9 100644 --- a/lib/ext2fs/mmp.c +++ b/lib/ext2fs/mmp.c @@ -168,6 +168,7 @@ unsigned ext2fs_mmp_new_seq(void) #endif } +#ifdef CONFIG_MMP static errcode_t ext2fs_mmp_reset(ext2_filsys fs) { struct mmp_struct *mmp_s = NULL; @@ -201,6 +202,7 @@ static errcode_t ext2fs_mmp_reset(ext2_filsys fs) out: return retval; } +#endif errcode_t ext2fs_mmp_update(ext2_filsys fs) { diff --git a/lib/ss/get_readline.c b/lib/ss/get_readline.c index 8da85f1..6eb66a9 100644 --- a/lib/ss/get_readline.c +++ b/lib/ss/get_readline.c @@ -21,9 +21,9 @@ #include #endif +#ifdef HAVE_DLOPEN static void ss_release_readline(ss_data *info) { -#ifdef HAVE_DLOPEN if (!info->readline_handle) return; @@ -33,8 +33,8 @@ static void ss_release_readline(ss_data *info) info->rl_completion_matches = 0; dlclose(info->readline_handle); info->readline_handle = 0; -#endif } +#endif /* Libraries we will try to use for readline/editline functionality */ #define DEFAULT_LIBPATH "libreadline.so.6:libreadline.so.5:libreadline.so.4:libreadline.so:libedit.so.2:libedit.so:libeditline.so.0:libeditline.so" diff --git a/lib/uuid/gen_uuid.c b/lib/uuid/gen_uuid.c index 22b4513..e89cccc 100644 --- a/lib/uuid/gen_uuid.c +++ b/lib/uuid/gen_uuid.c @@ -425,6 +425,7 @@ try_again: return 0; } +#if defined(USE_UUIDD) && defined(HAVE_SYS_UN_H) static ssize_t read_all(int fd, char *buf, size_t count) { ssize_t ret; @@ -475,7 +476,7 @@ static void close_all_fds(void) open("/dev/null", O_RDWR); } } - +#endif /* defined(USE_UUIDD) && defined(HAVE_SYS_UN_H) */ /* * Try using the uuidd daemon to generate the UUID diff --git a/misc/e4crypt.c b/misc/e4crypt.c index 2600d95..3fd6c1c 100644 --- a/misc/e4crypt.c +++ b/misc/e4crypt.c @@ -600,11 +600,6 @@ static void insert_key_into_keyring(const char *keyring, struct salt *salt) } } -static int is_keyring_valid(const char *keyring) -{ - return (get_keyring_id(keyring) != 0); -} - void get_default_salts(void) { FILE *f = setmntent("/etc/mtab", "r"); -- 1.8.3.1