OSDN Git Service

Eliminate unused function warnings from Android build
authorTheodore Ts'o <tytso@mit.edu>
Mon, 13 Jul 2015 03:09:15 +0000 (23:09 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 13 Jul 2015 03:09:15 +0000 (23:09 -0400)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/ismounted.c
lib/ext2fs/mmp.c
lib/ss/get_readline.c
lib/uuid/gen_uuid.c
misc/e4crypt.c

index 6c6ecff..b1eff85 100644 (file)
@@ -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
index 3947b1f..8d927d9 100644 (file)
@@ -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)
 {
index 8da85f1..6eb66a9 100644 (file)
@@ -21,9 +21,9 @@
 #include <dlfcn.h>
 #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"
index 22b4513..e89cccc 100644 (file)
@@ -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
index 2600d95..3fd6c1c 100644 (file)
@@ -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");