summaryrefslogtreecommitdiffstats
path: root/src/sessionp.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2011-08-28 09:53:47 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2011-08-28 09:53:47 +0200
commit789bb8645ba36a8f73ec48e6b9e8a61650fc6e5d (patch)
tree8d1741aed1229d264ce8550e676afb2c94662809 /src/sessionp.c
parent94082d99f501a58c397da923d505ec5b2944a6bd (diff)
PhotoRec session management: restart PhotoRec at the same location than previously
Diffstat (limited to 'src/sessionp.c')
-rw-r--r--src/sessionp.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/src/sessionp.c b/src/sessionp.c
index 1d792eb..69ae8a8 100644
--- a/src/sessionp.c
+++ b/src/sessionp.c
@@ -209,7 +209,40 @@ int session_save(alloc_data_t *list_free_space, struct ph_param *params, const
fprintf(f_session,"freespace,");
else
fprintf(f_session,"wholespace,");
- fprintf(f_session,"search,inter\n");
+ fprintf(f_session,"search,");
+ switch(params->status)
+ {
+ case STATUS_UNFORMAT:
+ fprintf(f_session, "status=unformat,");
+ break;
+ case STATUS_FIND_OFFSET:
+ fprintf(f_session, "status=find_offset,");
+ break;
+ case STATUS_EXT2_ON_BF:
+ fprintf(f_session, "status=ext2_on_bf,");
+ break;
+ case STATUS_EXT2_ON_SAVE_EVERYTHING:
+ fprintf(f_session, "status=ext2_on_save_everything,");
+ break;
+ case STATUS_EXT2_ON:
+ fprintf(f_session, "status=ext2_on,");
+ break;
+ case STATUS_EXT2_OFF_SAVE_EVERYTHING:
+ fprintf(f_session, "status=ext2_off_save_everything,");
+ break;
+ case STATUS_EXT2_OFF_BF:
+ fprintf(f_session, "status=ext2_off_bf,");
+ break;
+ case STATUS_EXT2_OFF:
+ fprintf(f_session, "status=ext2_off,");
+ break;
+ case STATUS_QUIT:
+ break;
+ }
+ if(params->status!=STATUS_QUIT && params->offset!=-1)
+ fprintf(f_session, "%llu,",
+ (long long unsigned)(params->offset/params->disk->sector_size));
+ fprintf(f_session,"inter\n");
td_list_for_each(free_walker, &list_free_space->list)
{
alloc_data_t *current_free_space;