summaryrefslogtreecommitdiff
path: root/ext4_utils/make_ext4fs.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext4_utils/make_ext4fs.c')
-rw-r--r--ext4_utils/make_ext4fs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext4_utils/make_ext4fs.c b/ext4_utils/make_ext4fs.c
index 58069f31..0151026a 100644
--- a/ext4_utils/make_ext4fs.c
+++ b/ext4_utils/make_ext4fs.c
@@ -628,6 +628,13 @@ static void extract_base_fs_allocations(const char *directory, const char *mount
int start_block, end_block;
u32 block_file_size;
u32 real_file_block_size;
+ struct stat buf;
+
+ if (lstat(real_file_name, &buf) == -1)
+ critical_error(err_msg);
+
+ if (!S_ISREG(buf.st_mode))
+ continue;
real_file_fd = open(real_file_name, O_RDONLY);
if (real_file_fd == -1) {