]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commit - lib/ext2fs/ext2fs.h
libext2fs: use HAVE_FSTAT64 instead of HAVE_STAT64 for ext2fs_stat()
authorTheodore Ts'o <tytso@mit.edu>
Thu, 10 Nov 2011 12:33:02 +0000 (07:33 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 10 Nov 2011 12:33:02 +0000 (07:33 -0500)
commita9f46078c4313a466c7014c733dc3a4daa8fdec4
tree9f9853a17f1fa2ec17b5fc3a344d22c8d995eb38
parentfc4fd955f705bdbdf5512b1c739191f17d483135
libext2fs: use HAVE_FSTAT64 instead of HAVE_STAT64 for ext2fs_stat()

Commit 6b56f3d92d introduced the use of HAVE_STAT64 without arranging
that it be defined in configure.in.  Previously ext4.h used
HAVE_OPEN64, but apparently there are (broken) platforms that have
open64() but not stat64().  Go figure.

We do need to consistently use a single test for ext2fs_stat(),
ext2fs_fstat(), and struct ext2fs_struct_stat, or we could end up
passing a struct stat64 to a fstat() system call, or some such.  I've
elected to use HAVE_FSTAT64 because: (a) it's already defined in the
configure script, and (b) if we ever come across a really broken
platform that defines fstat64() but not stat64(), we can always
emulate stat64() using open64() followed by a fstat64().

This commit fixed a bug whose symptoms were that mke2fs would not work
if given a file > 2GB on 32-bit platforms.

Addresses-Debian-Bug: #647245

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/ext2fs/ext2fs.h