summaryrefslogtreecommitdiffstats
path: root/src/photorec.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/photorec.c
parentefc94ee87ac3b4e3ecf4fb3ab4adac2ef0a6278f (diff)
add gcc_struct attribute to all __packed__ structure
do not use fseeko() with mingw32 gcc compiler
Diffstat (limited to 'src/photorec.c')
-rw-r--r--src/photorec.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/photorec.c b/src/photorec.c
index 895a2ce..7d6bc3f 100644
--- a/src/photorec.c
+++ b/src/photorec.c
@@ -55,6 +55,12 @@
#include "setdate.h"
#include "dfxml.h"
+#if defined(HAVE_FSEEKO) && !defined(__MINGW32__)
+#define my_fseek fseeko
+#else
+#define my_fseek fseek
+#endif
+
/* #define DEBUG_FILE_FINISH */
/* #define DEBUG_UPDATE_SEARCH_SPACE */
/* #define DEBUG_FREE */
@@ -1137,11 +1143,7 @@ void file_block_truncate_and_move(file_recovery_t *file_recovery, alloc_data_t *
uint64_t i;
unsigned char *block_buffer;
block_buffer=&buffer[blocksize];
-#ifdef HAVE_FSEEKO
- if(fseeko(file_recovery->handle, 0, SEEK_SET) < 0)
-#else
- if(fseek(file_recovery->handle, 0, SEEK_SET) < 0)
-#endif
+ if(my_fseek(file_recovery->handle, 0, SEEK_SET) < 0)
return ;
for(i=0; i< file_recovery->file_size; i+= blocksize)
{
@@ -1153,12 +1155,7 @@ void file_block_truncate_and_move(file_recovery_t *file_recovery, alloc_data_t *
}
else
{
-#ifdef HAVE_FSEEKO
- if(fseeko(file_recovery->handle, file_recovery->file_size, SEEK_SET) < 0)
- return ;
-#else
- if(fseek(file_recovery->handle, file_recovery->file_size, SEEK_SET) < 0)
+ if(my_fseek(file_recovery->handle, file_recovery->file_size, SEEK_SET) < 0)
return ;
-#endif
}
}