summaryrefslogtreecommitdiff
path: root/misc/tune2fs.c
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2023-01-21 12:32:27 -0800
committerTheodore Ts'o <tytso@mit.edu>2023-01-27 12:48:15 -0500
commit0352d353adbe6c5d6f1937e12c66e599b8657d72 (patch)
treec5f9d4a4820d67b2dfd63eb3ee7bb1542fcd74f1 /misc/tune2fs.c
parentde4f0ad497b0c1cb38b0dc12b550e8a6c6581472 (diff)
downloade2fsprogs-0352d353adbe6c5d6f1937e12c66e599b8657d72.tar.gz
misc/tune2fs: fix -Wunused-variable warnings in handle_fslabel()
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>
Diffstat (limited to 'misc/tune2fs.c')
-rw-r--r--misc/tune2fs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index 2f7d9f3c..458f7cf6 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -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) {