summaryrefslogtreecommitdiffstats
path: root/src/psearchn.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2016-02-21 10:35:09 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2016-02-21 10:35:09 +0100
commit0df900e32ca82fb9f2153fd3bddd4822b6e3cd34 (patch)
treede4a232a103eddb3fd39a2c8f203bf5d2d25ff04 /src/psearchn.c
parent49b29265de05800be25d5a6ec70d3d4e8935e0b9 (diff)
PhotoRec: If it takes more then 30s to save the session, save every 15 minutes instead of every 5 minutes.
Diffstat (limited to 'src/psearchn.c')
-rw-r--r--src/psearchn.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/psearchn.c b/src/psearchn.c
index c614629..fdf593a 100644
--- a/src/psearchn.c
+++ b/src/psearchn.c
@@ -426,9 +426,12 @@ pstatus_t photorec_aux(struct ph_param *params, const struct ph_options *options
params->offset=offset;
if(current_time >= next_checkpoint)
{
+ time_t new_time;
/* Save current progress */
session_save(list_search_space, params, options);
- next_checkpoint=current_time+5*60;
+ new_time=time(NULL);
+ /* If it takes more then 30s to save the session, save every 15 minutes instead of every 5 minutes */
+ next_checkpoint=new_time+(current_time+30<new_time?15:5)*60;
}
if(ind_stop!=PSTATUS_OK)
{