From: Theodore Ts'o Date: Mon, 21 Jan 2008 18:45:00 +0000 (-0500) Subject: Explicitly check for ftruncate64() in configure.in X-Git-Tag: v1.40.5~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=261cd3964fe1421bc8b9024c84888a5f1cba4195;p=thirdparty%2Fe2fsprogs.git Explicitly check for ftruncate64() in configure.in Apparently Mac OS 10.5 defines fstat64(), but not ftruncate64(), causing resize2fs to fail to build. So check explicitly for ftruncate64(), and fall back to ftruncate() if necessary. Signed-off-by: "Theodore Ts'o" --- diff --git a/configure b/configure index 4ab9e9437..6cda01c05 100755 --- a/configure +++ b/configure @@ -14860,7 +14860,8 @@ fi -for ac_func in chflags getrusage llseek lseek64 open64 fstat64 getmntinfo strtoull strcasecmp srandom jrand48 fchown mallinfo fdatasync strnlen strptime strdup sysconf pathconf posix_memalign memalign valloc __secure_getenv prctl mmap utime setresuid setresgid + +for ac_func in chflags getrusage llseek lseek64 open64 fstat64 ftruncate64 getmntinfo strtoull strcasecmp srandom jrand48 fchown mallinfo fdatasync strnlen strptime strdup sysconf pathconf posix_memalign memalign valloc __secure_getenv prctl mmap utime setresuid setresgid do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 diff --git a/configure.in b/configure.in index 12baa6b06..799015d27 100644 --- a/configure.in +++ b/configure.in @@ -747,7 +747,7 @@ AC_CHECK_MEMBER(struct sockaddr.sa_len, [#include #include ]) dnl -AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 fstat64 getmntinfo strtoull strcasecmp srandom jrand48 fchown mallinfo fdatasync strnlen strptime strdup sysconf pathconf posix_memalign memalign valloc __secure_getenv prctl mmap utime setresuid setresgid) +AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 fstat64 ftruncate64 getmntinfo strtoull strcasecmp srandom jrand48 fchown mallinfo fdatasync strnlen strptime strdup sysconf pathconf posix_memalign memalign valloc __secure_getenv prctl mmap utime setresuid setresgid) dnl dnl Check to see if -lsocket is required (solaris) to make something dnl that uses socket() to compile; this is needed for the UUID library diff --git a/resize/main.c b/resize/main.c index b3f80f7e6..f283e4123 100644 --- a/resize/main.c +++ b/resize/main.c @@ -413,7 +413,7 @@ int main (int argc, char ** argv) if ((st_buf.st_size > new_file_size) && (fd > 0)) { -#ifdef HAVE_FSTAT64 +#ifdef HAVE_FTRUNCATE64 ftruncate64(fd, new_file_size); #else /* Only truncate if new_file_size doesn't overflow off_t */