diff options
| -rw-r--r-- | configure.ac | 27 | ||||
| -rw-r--r-- | src/Makefile.am | 10 | ||||
| -rw-r--r-- | src/libirecovery.c | 6 |
3 files changed, 38 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index d7aafbf..7a28800 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -95,6 +95,33 @@ case "$GLOBAL_CFLAGS" in | |||
| 95 | AC_DEFINE([HAVE_FVISIBILITY], [1], [Define if compiled with -fvisibility=hidden]) | 95 | AC_DEFINE([HAVE_FVISIBILITY], [1], [Define if compiled with -fvisibility=hidden]) |
| 96 | esac | 96 | esac |
| 97 | 97 | ||
| 98 | # check for large file support | ||
| 99 | AC_SYS_LARGEFILE | ||
| 100 | LFS_CFLAGS='' | ||
| 101 | if test "$enable_largefile" != no; then | ||
| 102 | if test "$ac_cv_sys_file_offset_bits" != 'no'; then | ||
| 103 | LFS_CFLAGS="$LFS_CFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits" | ||
| 104 | else | ||
| 105 | AC_MSG_CHECKING(for native large file support) | ||
| 106 | AC_RUN_IFELSE([AC_LANG_SOURCE([#include <unistd.h> | ||
| 107 | int main (int argc, char **argv) | ||
| 108 | { | ||
| 109 | exit(!(sizeof(off_t) == 8)); | ||
| 110 | }])], | ||
| 111 | [ac_cv_sys_file_offset_bits=64; AC_DEFINE(_FILE_OFFSET_BITS,64) | ||
| 112 | AC_MSG_RESULT(yes)], | ||
| 113 | [AC_MSG_RESULT(no)]) | ||
| 114 | fi | ||
| 115 | if test "$ac_cv_sys_large_files" != 'no'; then | ||
| 116 | LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES=1" | ||
| 117 | fi | ||
| 118 | AC_FUNC_FSEEKO | ||
| 119 | if test "$ac_cv_sys_largefile_source" != 'no'; then | ||
| 120 | LFS_CFLAGS="$LFS_CFLAGS -D_LARGEFILE_SOURCE=1" | ||
| 121 | fi | ||
| 122 | fi | ||
| 123 | AC_SUBST(LFS_CFLAGS) | ||
| 124 | |||
| 98 | m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) | 125 | m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) |
| 99 | 126 | ||
| 100 | AC_OUTPUT([ | 127 | AC_OUTPUT([ |
diff --git a/src/Makefile.am b/src/Makefile.am index 4316454..73ae945 100644 --- a/src/Makefile.am +++ b/src/Makefile.am | |||
| @@ -1,7 +1,13 @@ | |||
| 1 | AM_CPPFLAGS = -I$(top_srcdir)/include | 1 | AM_CPPFLAGS = -I$(top_srcdir)/include |
| 2 | 2 | ||
| 3 | AM_CFLAGS = $(GLOBAL_CFLAGS) $(libusb_CFLAGS) | 3 | AM_CFLAGS = \ |
| 4 | AM_LDFLAGS = $(libusb_LIBS) $(LIBIRECOVERYLDFLAGS) | 4 | $(GLOBAL_CFLAGS) \ |
| 5 | $(LFS_CFLAGS) \ | ||
| 6 | $(libusb_CFLAGS) | ||
| 7 | |||
| 8 | AM_LDFLAGS = \ | ||
| 9 | $(libusb_LIBS) \ | ||
| 10 | $(LIBIRECOVERYLDFLAGS) | ||
| 5 | 11 | ||
| 6 | lib_LTLIBRARIES = libirecovery.la | 12 | lib_LTLIBRARIES = libirecovery.la |
| 7 | libirecovery_la_CFLAGS = $(AM_CFLAGS) | 13 | libirecovery_la_CFLAGS = $(AM_CFLAGS) |
diff --git a/src/libirecovery.c b/src/libirecovery.c index d632b63..fa0f417 100644 --- a/src/libirecovery.c +++ b/src/libirecovery.c | |||
| @@ -1129,9 +1129,9 @@ IRECV_API irecv_error_t irecv_send_file(irecv_client_t client, const char* filen | |||
| 1129 | return IRECV_E_FILE_NOT_FOUND; | 1129 | return IRECV_E_FILE_NOT_FOUND; |
| 1130 | } | 1130 | } |
| 1131 | 1131 | ||
| 1132 | fseek(file, 0, SEEK_END); | 1132 | fseeko(file, 0, SEEK_END); |
| 1133 | long length = ftell(file); | 1133 | long length = ftello(file); |
| 1134 | fseek(file, 0, SEEK_SET); | 1134 | fseeko(file, 0, SEEK_SET); |
| 1135 | 1135 | ||
| 1136 | char* buffer = (char*) malloc(length); | 1136 | char* buffer = (char*) malloc(length); |
| 1137 | if (buffer == NULL) { | 1137 | if (buffer == NULL) { |
