diff mbox series

[33/38] misc/mke2fs: fix a -Wunused-variable warning in PRS()

Message ID 20230121203230.27624-34-ebiggers@kernel.org
State Accepted
Headers show
Series e2fsprogs: misc fixes, and add a GitHub Actions file | expand

Commit Message

Eric Biggers Jan. 21, 2023, 8:32 p.m. UTC
From: Eric Biggers <ebiggers@google.com>

This showed up when building for Windows.

Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 misc/mke2fs.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 24cc14750..7028d3935 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -1598,7 +1598,6 @@  static void PRS(int argc, char *argv[])
 	 * Finally, we complain about fs_blocks_count > 2^32 on a non-64bit fs.
 	 */
 	blk64_t		fs_blocks_count = 0;
-	long		sysval;
 	int		s_opt = -1, r_opt = -1;
 	char		*fs_features = 0;
 	int		fs_features_size = 0;
@@ -1632,9 +1631,12 @@  static void PRS(int argc, char *argv[])
 #define _SC_PAGESIZE _SC_PAGE_SIZE
 #endif
 #ifdef _SC_PAGESIZE
-	sysval = sysconf(_SC_PAGESIZE);
-	if (sysval > 0)
-		sys_page_size = sysval;
+	{
+		long sysval = sysconf(_SC_PAGESIZE);
+
+		if (sysval > 0)
+			sys_page_size = sysval;
+	}
 #endif /* _SC_PAGESIZE */
 #endif /* HAVE_SYSCONF */