summaryrefslogtreecommitdiffstats
path: root/src/qpsearch.cpp
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2013-12-14 21:36:24 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2013-12-14 21:40:04 +0100
commit3213247d998d58627eb4029afce6be8680de3b30 (patch)
tree96d4a64aca2201410703b5c15589715fe1557aa1 /src/qpsearch.cpp
parent5de0329f2184bdf89e087f414b651448df096c1f (diff)
PhotoRec: use an enum for values returned by data_check()
rename .m2ts and .ts using pid from header
Diffstat (limited to 'src/qpsearch.cpp')
-rw-r--r--src/qpsearch.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/qpsearch.cpp b/src/qpsearch.cpp
index 06a10e0..87962f3 100644
--- a/src/qpsearch.cpp
+++ b/src/qpsearch.cpp
@@ -262,7 +262,7 @@ pstatus_t QPhotorec::photorec_aux(alloc_data_t *list_search_space)
}
if(file_recovery.file_stat!=NULL)
{
- int res=1;
+ data_check_t res=DC_CONTINUE;
/* try to skip ext2/ext3 indirect block */
if((params->status==STATUS_EXT2_ON || params->status==STATUS_EXT2_ON_SAVE_EVERYTHING) &&
file_recovery.file_size_on_disk>=12*blocksize &&
@@ -288,7 +288,7 @@ pstatus_t QPhotorec::photorec_aux(alloc_data_t *list_search_space)
if(errno==EFBIG)
{
/* File is too big for the destination filesystem */
- res=2;
+ res=DC_STOP;
}
else
{
@@ -305,26 +305,26 @@ pstatus_t QPhotorec::photorec_aux(alloc_data_t *list_search_space)
res=file_recovery.data_check(buffer_olddata,2*blocksize,&file_recovery);
file_recovery.file_size+=blocksize;
file_recovery.file_size_on_disk+=blocksize;
- if(res==2)
+ if(res==DC_STOP)
{
if(options->verbose > 1)
log_trace("EOF found\n");
}
}
}
- if(res!=2 && file_recovery.file_stat->file_hint->max_filesize>0 && file_recovery.file_size>=file_recovery.file_stat->file_hint->max_filesize)
+ if(res!=DC_STOP && res!=DC_ERROR && file_recovery.file_stat->file_hint->max_filesize>0 && file_recovery.file_size>=file_recovery.file_stat->file_hint->max_filesize)
{
- res=2;
+ res=DC_STOP;
log_verbose("File should not be bigger than %llu, stop adding data\n",
(long long unsigned)file_recovery.file_stat->file_hint->max_filesize);
}
- if(res!=2 && file_recovery.file_size + blocksize >= PHOTOREC_MAX_SIZE_32 && is_fat(params->partition))
+ if(res!=DC_STOP && res!=DC_ERROR && file_recovery.file_size + blocksize >= PHOTOREC_MAX_SIZE_32 && is_fat(params->partition))
{
- res=2;
+ res=DC_STOP;
log_verbose("File should not be bigger than %llu, stop adding data\n",
(long long unsigned)file_recovery.file_stat->file_hint->max_filesize);
}
- if(res==2)
+ if(res==DC_STOP || res==DC_ERROR)
{
file_recovered=file_finish2(&file_recovery, params, options, list_search_space, &current_search_space, &offset);
reset_file_recovery(&file_recovery);