[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230121203230.27624-28-ebiggers@kernel.org>
Date: Sat, 21 Jan 2023 12:32:19 -0800
From: Eric Biggers <ebiggers@...nel.org>
To: linux-ext4@...r.kernel.org
Subject: [PATCH 27/38] misc/create_inode: fix -Wunused-variable warnings in __populate_fs()
From: Eric Biggers <ebiggers@...gle.com>
These showed up when building for Windows.
Signed-off-by: Eric Biggers <ebiggers@...gle.com>
---
misc/create_inode.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/misc/create_inode.c b/misc/create_inode.c
index c00d54588..7ce69c2b0 100644
--- a/misc/create_inode.c
+++ b/misc/create_inode.c
@@ -813,11 +813,9 @@ static errcode_t __populate_fs(ext2_filsys fs, ext2_ino_t parent_ino,
const char *name;
struct dirent **dent;
struct stat st;
- char *ln_target = NULL;
unsigned int save_inode;
ext2_ino_t ino;
errcode_t retval = 0;
- int read_cnt;
int hdlink;
size_t cur_dir_path_len;
int i, num_dents;
@@ -900,7 +898,10 @@ static errcode_t __populate_fs(ext2_filsys fs, ext2_ino_t parent_ino,
goto out;
}
break;
- case S_IFLNK:
+ case S_IFLNK: {
+ char *ln_target;
+ int read_cnt;
+
ln_target = malloc(st.st_size + 1);
if (ln_target == NULL) {
com_err(__func__, retval,
@@ -935,7 +936,8 @@ static errcode_t __populate_fs(ext2_filsys fs, ext2_ino_t parent_ino,
goto out;
}
break;
-#endif
+ }
+#endif /* !_WIN32 */
case S_IFREG:
retval = do_write_internal(fs, parent_ino, name, name,
root);
--
2.39.0
Powered by blists - more mailing lists