summaryrefslogtreecommitdiffstats
path: root/src/filegen.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2015-09-25 20:32:08 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2015-09-25 20:32:08 +0200
commit5d18a4828bc74677ec17db07a4d8de2cc75be032 (patch)
treec4b10474ddd5eca6447f8fe4a541f7b0c35f961e /src/filegen.c
parent21827baef53aaa4a8c97f35850722b93c42f5914 (diff)
Fallback to fseek() if fseeko() failed
Diffstat (limited to 'src/filegen.c')
-rw-r--r--src/filegen.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/filegen.c b/src/filegen.c
index d80097c..ffde54f 100644
--- a/src/filegen.c
+++ b/src/filegen.c
@@ -37,12 +37,6 @@
#include "photorec.h"
#include "log.h"
-#if defined(HAVE_FSEEKO) && !defined(__MINGW32__)
-#define my_fseek fseeko
-#else
-#define my_fseek fseek
-#endif
-
static file_check_t file_check_plist={
.list = TD_LIST_HEAD_INIT(file_check_plist.list)
};
@@ -626,3 +620,15 @@ void get_prev_location_smart(alloc_data_t *list_search_space, alloc_data_t **cur
}
offset_skipped_header=0;
}
+
+int my_fseek(FILE *stream, off_t offset, int whence)
+{
+#if defined(HAVE_FSEEKO) && !defined(__MINGW32__) && !defined(__ARM_EABI__)
+ {
+ int res;
+ if((res=fseeko(stream, offset, whence))>=0)
+ return res;
+ }
+#endif
+ return fseek(stream, offset, whence);
+}