]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
misc/tune2fs: fix -Wunused-variable warnings in handle_fslabel()
authorEric Biggers <ebiggers@google.com>
Sat, 21 Jan 2023 20:32:27 +0000 (12:32 -0800)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 27 Jan 2023 17:48:15 +0000 (12:48 -0500)
These warnings show up in non-Linux builds.  To fix them, only declare
local variables when they are needed.

While we're here, also make handle_fslabel() static.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/tune2fs.c

index 2f7d9f3cb0e9fd250aa259871c34b4de5c89bee1..458f7cf6a8e667220f049593bb9e6b14bdfa3212 100644 (file)
@@ -3085,14 +3085,15 @@ fs_update_journal_user(struct ext2_super_block *sb, __u8 old_uuid[UUID_SIZE])
  *             1 on error
  *             -1 when the old method should be used
  */
-int handle_fslabel(int setlabel) {
+static int handle_fslabel(int setlabel)
+{
+#ifdef __linux__
        errcode_t ret;
        int mnt_flags, fd;
        char label[FSLABEL_MAX];
        int maxlen = FSLABEL_MAX - 1;
        char mntpt[PATH_MAX + 1];
 
-#ifdef __linux__
        ret = ext2fs_check_mount_point(device_name, &mnt_flags,
                                          mntpt, sizeof(mntpt));
        if (ret) {