libext2fs: fix ext2fs_get_device_size2() return value on Windows

Creating a file system on Windows without a pre-existing file stopped
working because the Windows version of ext2fs_get_device_size2() doesn't
return ENOENT if the file doesn't exist.  Fix this.

Fixes: 53464654bd33 ("mke2fs: fix creating a file system image w/o a pre-existing file")
Bug: 271039230
Change-Id: I2ee1db4cbea85047acac449fa0179e5b7e778ae5
Signed-off-by: Eric Biggers <>
3 files changed