summaryrefslogtreecommitdiffstats
path: root/src/phbf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/phbf.c')
-rw-r--r--src/phbf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/phbf.c b/src/phbf.c
index 5d501a3..f5e1103 100644
--- a/src/phbf.c
+++ b/src/phbf.c
@@ -76,6 +76,7 @@
#define READ_SIZE 1024*512
extern file_check_list_t file_check_list;
extern uint64_t free_list_allocation_end;
+extern int need_to_stop;
typedef enum { BF_OK=0, BF_STOP=1, BF_EACCES=2, BF_ENOSPC=3, BF_FRAG_FOUND=4, BF_EOF=5, BF_ENOENT=6, BF_ERANGE=7} bf_status_t;
@@ -170,6 +171,7 @@ pstatus_t photorec_bf(struct ph_param *params, const struct ph_options *options,
file_recovery_t file_recovery_new;
// memset(&file_recovery_new, 0, sizeof(file_recovery_t));
file_recovery_new.blocksize=blocksize;
+ file_recovery_new.location.start=offset;
file_recovery_new.file_stat=NULL;
td_list_for_each(tmpl, &file_check_list.list)
{
@@ -190,7 +192,6 @@ pstatus_t photorec_bf(struct ph_param *params, const struct ph_options *options,
}
if(file_recovery_new.file_stat!=NULL)
{
- file_recovery_new.location.start=offset;
if(options->verbose>0)
{
log_info("%s header found at sector %lu\n",
@@ -643,6 +644,8 @@ static bf_status_t photorec_bf_frag(struct ph_param *params, file_recovery_t *fi
ind_stop=photorec_progressbar(stdscr, testbf, params,
file_recovery->location.start, current_time);
#endif
+ if(need_to_stop!=0)
+ ind_stop=PSTATUS_STOP;
if(ind_stop!=PSTATUS_OK)
{
file_recovery->flags=0;