src/psearchn.c: rename local variable from res to data_check_status

This commit is contained in:
Christophe Grenier 2020-08-07 08:19:44 +02:00
parent 9b0e8ff284
commit 5106d055ca

View file

@ -117,7 +117,7 @@ pstatus_t photorec_aux(struct ph_param *params, const struct ph_options *options
{ {
pfstatus_t file_recovered=PFSTATUS_BAD; pfstatus_t file_recovered=PFSTATUS_BAD;
uint64_t old_offset=offset; uint64_t old_offset=offset;
data_check_t res=DC_SCAN; data_check_t data_check_status=DC_SCAN;
#ifdef DEBUG #ifdef DEBUG
log_debug("sector %llu\n", log_debug("sector %llu\n",
(unsigned long long)((offset-params->partition->part_offset)/params->disk->sector_size)); (unsigned long long)((offset-params->partition->part_offset)/params->disk->sector_size));
@ -140,7 +140,7 @@ pstatus_t photorec_aux(struct ph_param *params, const struct ph_options *options
ind_block(buffer,blocksize)!=0) ind_block(buffer,blocksize)!=0)
{ {
file_block_append(&file_recovery, list_search_space, &current_search_space, &offset, blocksize, 0); file_block_append(&file_recovery, list_search_space, &current_search_space, &offset, blocksize, 0);
res=DC_CONTINUE; data_check_status=DC_CONTINUE;
if(options->verbose > 1) if(options->verbose > 1)
{ {
log_verbose("Skipping sector %10lu/%lu\n", log_verbose("Skipping sector %10lu/%lu\n",
@ -159,7 +159,7 @@ pstatus_t photorec_aux(struct ph_param *params, const struct ph_options *options
if(errno==EFBIG) if(errno==EFBIG)
{ {
/* File is too big for the destination filesystem */ /* File is too big for the destination filesystem */
res=DC_STOP; data_check_status=DC_STOP;
} }
else else
{ {
@ -173,32 +173,32 @@ pstatus_t photorec_aux(struct ph_param *params, const struct ph_options *options
{ {
file_block_append(&file_recovery, list_search_space, &current_search_space, &offset, blocksize, 1); file_block_append(&file_recovery, list_search_space, &current_search_space, &offset, blocksize, 1);
if(file_recovery.data_check!=NULL) if(file_recovery.data_check!=NULL)
res=file_recovery.data_check(buffer_olddata,2*blocksize,&file_recovery); data_check_status=file_recovery.data_check(buffer_olddata,2*blocksize,&file_recovery);
else else
res=DC_CONTINUE; data_check_status=DC_CONTINUE;
file_recovery.file_size+=blocksize; file_recovery.file_size+=blocksize;
if(res==DC_STOP) if(data_check_status==DC_STOP)
{ {
if(options->verbose > 1) if(options->verbose > 1)
log_trace("EOF found\n"); log_trace("EOF found\n");
} }
} }
} }
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) if(data_check_status!=DC_STOP && data_check_status!=DC_ERROR && file_recovery.file_stat->file_hint->max_filesize>0 && file_recovery.file_size>=file_recovery.file_stat->file_hint->max_filesize)
{ {
res=DC_STOP; data_check_status=DC_STOP;
log_verbose("File should not be bigger than %llu, stopped adding data\n", log_verbose("File should not be bigger than %llu, stopped adding data\n",
(long long unsigned)file_recovery.file_stat->file_hint->max_filesize); (long long unsigned)file_recovery.file_stat->file_hint->max_filesize);
} }
if(res!=DC_STOP && res!=DC_ERROR && file_recovery.file_size + blocksize >= PHOTOREC_MAX_SIZE_32 && is_fat(params->partition)) if(data_check_status!=DC_STOP && data_check_status!=DC_ERROR && file_recovery.file_size + blocksize >= PHOTOREC_MAX_SIZE_32 && is_fat(params->partition))
{ {
res=DC_STOP; data_check_status=DC_STOP;
log_verbose("File should not be bigger than %llu, stopped adding data\n", log_verbose("File should not be bigger than %llu, stopped adding data\n",
(long long unsigned)file_recovery.file_stat->file_hint->max_filesize); (long long unsigned)file_recovery.file_stat->file_hint->max_filesize);
} }
if(res==DC_STOP || res==DC_ERROR) if(data_check_status==DC_STOP || data_check_status==DC_ERROR)
{ {
if(res==DC_ERROR) if(data_check_status==DC_ERROR)
file_recovery.file_size=0; file_recovery.file_size=0;
file_recovered=file_finish2(&file_recovery, params, options->paranoid, list_search_space); file_recovered=file_finish2(&file_recovery, params, options->paranoid, list_search_space);
if(options->lowmem > 0) if(options->lowmem > 0)
@ -214,7 +214,7 @@ pstatus_t photorec_aux(struct ph_param *params, const struct ph_options *options
} }
if(file_recovered==PFSTATUS_BAD) if(file_recovered==PFSTATUS_BAD)
{ {
if(res==DC_SCAN) if(data_check_status==DC_SCAN)
{ {
if(file_recovered_old==PFSTATUS_OK) if(file_recovered_old==PFSTATUS_OK)
{ {