summaryrefslogtreecommitdiffstats
path: root/src/phbf.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2019-12-08 10:04:02 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2019-12-08 10:04:02 +0100
commit6f24cf45f6f93f52b6bbb3ddb63118dd4a3d93cd (patch)
treeb2f799bc2faffb6f38d31aa363ea54f9ab66c903 /src/phbf.c
parent15eded4506dae30c4e5249e77660765128a92d03 (diff)
PhotoRec: When the first Ctrl-C/SIGINT, PhotoRec tries to emulate the Stop action in the interface.
The following signals flush the log file and the signals are propagated as it was done. Close https://github.com/cgsecurity/testdisk/issues/73
Diffstat (limited to 'src/phbf.c')
-rw-r--r--src/phbf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/phbf.c b/src/phbf.c
index 523abe4..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;
@@ -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;