[Box Backup-commit] COMMIT r2012 - in box/trunk: . lib/intercept
boxbackup-dev@fluffy.co.uk
boxbackup-dev@fluffy.co.uk
Tue, 18 Dec 2007 00:17:54 +0000 (UTC)
Author: chris
Date: 2007-12-18 00:17:54 +0000 (Tue, 18 Dec 2007)
New Revision: 2012
Modified:
box/trunk/configure.ac
box/trunk/lib/intercept/intercept.cpp
Log:
Search for readdir64 and stat64 if LARGE_FILE_SUPPORT is enabled, rather
than relying on Linux redirection macros that aren't present on
Slackware (which uses asm redirects instead).
Modified: box/trunk/configure.ac
===================================================================
--- box/trunk/configure.ac 2007-12-18 00:15:13 UTC (rev 2011)
+++ box/trunk/configure.ac 2007-12-18 00:17:54 UTC (rev 2012)
@@ -225,6 +225,11 @@
[have_large_file_support=yes], [have_large_file_support=no]
)])
+if test "x$have_large_file_support" = "xyes"; then
+ AC_DEFINE([HAVE_LARGE_FILE_SUPPORT], [1],
+ [Define to 1 if large files are supported])
+fi
+
## Find out how to do file locking
AC_CHECK_FUNCS([flock])
AC_CHECK_DECLS([O_EXLOCK],,, [[#include <fcntl.h>]])
Modified: box/trunk/lib/intercept/intercept.cpp
===================================================================
--- box/trunk/lib/intercept/intercept.cpp 2007-12-18 00:15:13 UTC (rev 2011)
+++ box/trunk/lib/intercept/intercept.cpp 2007-12-18 00:17:54 UTC (rev 2012)
@@ -457,7 +457,7 @@
if (readdir_real == NULL)
{
- #if defined readdir && readdir == readdir64
+ #ifdef HAVE_LARGE_FILE_SUPPORT
readdir_real = (readdir_t*)find_function("readdir64");
#else
readdir_real = (readdir_t*)find_function("readdir");
@@ -506,13 +506,13 @@
if (lstat_real == NULL)
{
#ifdef LINUX_WEIRD_LSTAT
- #if defined __lxstat && __lxstat == __lxstat64
+ #ifdef HAVE_LARGE_FILE_SUPPORT
lstat_real = (lstat_t*)find_function("__lxstat64");
#else
lstat_real = (lstat_t*)find_function("__lxstat");
#endif
#else
- #if defined lstat && lstat == lstat64
+ #ifdef HAVE_LARGE_FILE_SUPPORT
lstat_real = (lstat_t*)find_function("lstat64");
#else
lstat_real = (lstat_t*)find_function("lstat");