aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2023-01-21 12:32:19 -0800
committerTheodore Ts'o <tytso@mit.edu>2023-01-27 12:38:31 -0500
commita075bf746427810c4aab2be5d3852b10ce5dc3f1 (patch)
tree5f4956690431d00096fec3dc7c76e02c221ce4ae
parent013e5d86db02957d840d9fd331a677218dc693df (diff)
downloade2fsprogs-a075bf746427810c4aab2be5d3852b10ce5dc3f1.tar.gz
misc/create_inode: fix -Wunused-variable warnings in __populate_fs()
These showed up when building for Windows. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r--misc/create_inode.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/misc/create_inode.c b/misc/create_inode.c
index d7ab1c20c..f4a3653bf 100644
--- a/misc/create_inode.c
+++ b/misc/create_inode.c
@@ -815,11 +815,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;
@@ -902,7 +900,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,
@@ -937,7 +938,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);