summaryrefslogtreecommitdiffstats
path: root/src/phbf.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2015-04-11 14:23:16 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2015-04-11 14:23:16 +0200
commit67054372873f2ed5414da7fff1cb5744148289d6 (patch)
treea8cd9501bcfc1e1efec8ca6603e7f11b0ad2ec0c /src/phbf.c
parentefc94ee87ac3b4e3ecf4fb3ab4adac2ef0a6278f (diff)
add gcc_struct attribute to all __packed__ structure
do not use fseeko() with mingw32 gcc compiler
Diffstat (limited to 'src/phbf.c')
-rw-r--r--src/phbf.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/phbf.c b/src/phbf.c
index cb0bf95..3589eba 100644
--- a/src/phbf.c
+++ b/src/phbf.c
@@ -71,6 +71,12 @@
#include "phbf.h"
#include "phnc.h"
+#if defined(HAVE_FSEEKO) && !defined(__MINGW32__)
+#define my_fseek fseeko
+#else
+#define my_fseek fseek
+#endif
+
//#define DEBUG_BF
//#define DEBUG_BF2
#define READ_SIZE 1024*512
@@ -328,11 +334,7 @@ static bf_status_t photorec_bf_pad(struct ph_param *params, file_recovery_t *fil
uint64_t file_size_backup;
nbr=0;
offset_error_tmp=file_recovery->offset_error;
-#ifdef HAVE_FSEEKO
- if(fseeko(file_recovery->handle, file_recovery->file_size, SEEK_SET) < 0)
-#else
- if(fseek(file_recovery->handle, file_recovery->file_size, SEEK_SET) < 0)
-#endif
+ if(my_fseek(file_recovery->handle, file_recovery->file_size, SEEK_SET) < 0)
return BF_ENOENT;
#if 1
if(file_recovery->data_check!=NULL)