lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230121203230.27624-36-ebiggers@kernel.org>
Date:   Sat, 21 Jan 2023 12:32:27 -0800
From:   Eric Biggers <ebiggers@...nel.org>
To:     linux-ext4@...r.kernel.org
Subject: [PATCH 35/38] misc/tune2fs: fix -Wunused-variable warnings in handle_fslabel()

From: Eric Biggers <ebiggers@...gle.com>

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@...gle.com>
---
 misc/tune2fs.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index 7937b8b56..d3258149e 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -3082,14 +3082,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) {
-- 
2.39.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ