From: Theodore Ts'o Date: Mon, 13 Jul 2015 03:09:15 +0000 (-0400) Subject: Eliminate unused function warnings from Android build X-Git-Tag: v1.43-WIP-2016-03-15~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aee40b870cd70a884fd98a56d9c956945584b429;p=thirdparty%2Fe2fsprogs.git Eliminate unused function warnings from Android build Signed-off-by: Theodore Ts'o --- diff --git a/lib/ext2fs/ismounted.c b/lib/ext2fs/ismounted.c index 6c6ecff0e..b1eff85ed 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 3947b1f79..8d927d92d 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 8da85f12e..6eb66a91b 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 22b451342..e89ccccef 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 2600d95a3..3fd6c1ceb 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");