[PATCH 27/38] misc/create_inode: fix -Wunused-variable warnings in __populate_fs()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Eric Biggers <ebiggers@xxxxxxxxxx>

These showed up when building for Windows.

Signed-off-by: Eric Biggers <ebiggers@xxxxxxxxxx>
---
 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




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux