From 5118568923556949fa5e7b6657cabd1ebf490ae1 Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Thu, 28 Apr 2011 10:06:52 +0200 Subject: [PATCH] dfxml report was missing the first byte_run, fix it. --- src/dfxml.c | 8 ++++---- src/dfxml.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/dfxml.c b/src/dfxml.c index b0821eab..18d16012 100644 --- a/src/dfxml.c +++ b/src/dfxml.c @@ -316,11 +316,11 @@ void xml_log_file_recovered(const file_recovery_t *file_recovery) xml_pop("fileobject"); } -static void xml_log_file_recovered2_aux(const alloc_data_t *file, const uint64_t file_size) +static void xml_log_file_recovered2_aux(const alloc_data_t *space, const alloc_data_t *file, const uint64_t file_size) { struct td_list_head *tmp; uint64_t size=0; - td_list_for_each(tmp, &file->list) + for(tmp=&file->list; tmp!=&space->list; tmp=tmp->next) { const alloc_data_t *element=td_list_entry(tmp, alloc_data_t, list); if(size >= file_size) @@ -348,7 +348,7 @@ static void xml_log_file_recovered2_aux(const alloc_data_t *file, const uint64_t } } -void xml_log_file_recovered2(const file_recovery_t *file_recovery) +void xml_log_file_recovered2(const alloc_data_t *space, const file_recovery_t *file_recovery) { if(xml_handle==NULL) return; @@ -358,7 +358,7 @@ void xml_log_file_recovered2(const file_recovery_t *file_recovery) xml_out2s("filename", relative_name(file_recovery->filename)); xml_out2i("filesize", file_recovery->file_size); xml_push("byte_runs", ""); - xml_log_file_recovered2_aux(file_recovery->loc, file_recovery->file_size); + xml_log_file_recovered2_aux(space, file_recovery->loc, file_recovery->file_size); xml_pop("byte_runs"); xml_pop("fileobject"); } diff --git a/src/dfxml.h b/src/dfxml.h index 3ba9dd90..53aeff28 100644 --- a/src/dfxml.h +++ b/src/dfxml.h @@ -40,7 +40,7 @@ void xml_set_command_line(const int argc, char **argv); void xml_add_DFXML_creator(const char *package, const char *version); void xml_shutdown(void); void xml_log_file_recovered(const file_recovery_t *file_recovery); -void xml_log_file_recovered2(const file_recovery_t *file_recovery); +void xml_log_file_recovered2(const alloc_data_t *space, const file_recovery_t *file_recovery); void xml_printf(const char *__restrict __format,...) __attribute__((format(printf,1,2))); #ifdef __cplusplus } /* closing brace for extern "C" */