Skip to content

Commit

Permalink
fixes cvd load error on some i386 builds caused by -D_FILE_OFFSET_BIT…
Browse files Browse the repository at this point in the history
…S=64 and a long story
  • Loading branch information
Steve Morgan committed Nov 2, 2012
1 parent 875f4a8 commit 202c13e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
3 changes: 1 addition & 2 deletions configure
Expand Up @@ -18746,7 +18746,6 @@ else

#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
#define _FILE_OFFSET_BITS 64
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
Expand Down Expand Up @@ -18777,7 +18776,7 @@ if test "$enable_stat64" != "no"; then

$as_echo "#define HAVE_STAT64 1" >>confdefs.h

CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_stat64" >&5
$as_echo "$enable_stat64" >&6; }
Expand Down
3 changes: 1 addition & 2 deletions configure.ac
Expand Up @@ -1495,7 +1495,6 @@ AC_MSG_CHECKING([stat64])
AC_TRY_RUN([
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
#define _FILE_OFFSET_BITS 64
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
Expand All @@ -1518,7 +1517,7 @@ int main(void) {

if test "$enable_stat64" != "no"; then
AC_DEFINE([HAVE_STAT64],1,[enable stat64])
CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
fi
AC_MSG_RESULT([$enable_stat64])

Expand Down
8 changes: 4 additions & 4 deletions libclamav/Makefile.in
Expand Up @@ -587,8 +587,8 @@ EXTRA_DIST = c++/Makefile.nollvm.in $(am__append_4) regex/engine.c \
@ENABLE_UNRAR_TRUE@IFACEDEP = libclamunrar_iface.la
libclamav_internal_utils_la_SOURCES = str.c\
str.h\
iowrap.c\
iowrap.h\
iowrap.c \
iowrap.h \
md5.c\
md5.h\
others_common.c \
Expand All @@ -609,8 +609,8 @@ libclamav_internal_utils_la_LDFLAGS = -static
libclamav_internal_utils_la_CFLAGS = $(AM_CFLAGS) -fPIC -DPIC
libclamav_internal_utils_nothreads_la_SOURCES = str.c\
str.h\
iowrap.c\
iowrap.h\
iowrap.c \
iowrap.h \
md5.c\
md5.h\
others_common.c \
Expand Down
6 changes: 5 additions & 1 deletion libclamav/clamav.h
Expand Up @@ -32,13 +32,17 @@
#define STAT stat64
#define LSTAT lstat64
#define FSTAT fstat64

#define safe_open(a, b) open(a, b|O_LARGEFILE)
#else

#define STATBUF struct stat
#define STAT stat
#define LSTAT lstat
#define FSTAT fstat
/* Nothing is safe in windows, not even open, safe_open defined under /win32 */
#ifndef _WIN32
#define safe_open open
#endif

#endif

Expand Down
2 changes: 0 additions & 2 deletions platform.h.in
Expand Up @@ -38,8 +38,6 @@ typedef unsigned int in_addr_t;
#define CONFDIR_FRESHCLAM CONFDIR PATHSEP "freshclam.conf"
#define CONFDIR_MILTER CONFDIR PATHSEP "clamav-milter.conf"

/* Nothing is safe in windows, not even open */
#define safe_open open
#define cli_to_utf8_maybe_alloc(x) (x)
#define cli_strdup_to_utf8(x) strdup(x)
#ifndef WORDS_BIGENDIAN
Expand Down

0 comments on commit 202c13e

Please sign in to comment.