mke2fs: use ext2fs_open_file() in check_plausibility()

The commit:

802146c mke2fs: create a regular file if necessary

caused a regression on 32-bit machines; the open() fails if
the file size is > 4G.

Using ext2fs_open_file() fixes it.

Addresses-Red-Hat-Bugzilla: #1099892

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
maint-test
Eric Sandeen 2014-05-21 12:47:44 -05:00 committed by Theodore Ts'o
parent 9779e29610
commit a7b0f770b0
1 changed files with 2 additions and 2 deletions

View File

@ -194,10 +194,10 @@ int check_plausibility(const char *device, int flags, int *ret_is_dev)
char *fs_type = NULL;
char *fs_label = NULL;
fd = open(device, fl, 0666);
fd = ext2fs_open_file(device, fl, 0666);
if ((fd < 0) && (errno == ENOENT) && (flags & CREATE_FILE)) {
fl |= O_CREAT;
fd = open(device, fl, 0666);
fd = ext2fs_open_file(device, fl, 0666);
if (fd >= 0 && (flags & VERBOSE_CREATE))
printf(_("Creating regular file %s\n"), device);
}