From 261cd3964fe1421bc8b9024c84888a5f1cba4195 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 21 Jan 2008 13:45:00 -0500 Subject: [PATCH] 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" --- configure | 3 ++- configure.in | 2 +- resize/main.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 4ab9e94..6cda01c 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 12baa6b..799015d 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 b3f80f7..f283e41 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 */ -- 1.8.3.1