summaryrefslogtreecommitdiffstats
path: root/src/fnctdsk.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2014-02-01 10:57:37 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2014-02-01 10:57:37 +0100
commit5620526c2759ed193fbdac5af37537dfb404da65 (patch)
tree2503b9548189efaf05d4b6ca89ff20ea53c44a8f /src/fnctdsk.c
parentb7070ed9b2c1f7265e8ab537c9aacb948a8a5513 (diff)
move log_disk_list() to src/fnctdsk.c
return non zero error code in PhotoRec main to signal some errors
Diffstat (limited to 'src/fnctdsk.c')
-rw-r--r--src/fnctdsk.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/fnctdsk.c b/src/fnctdsk.c
index e50091d..0a766b2 100644
--- a/src/fnctdsk.c
+++ b/src/fnctdsk.c
@@ -406,3 +406,23 @@ void size_to_unit(const uint64_t disk_size, char *buffer)
else
sprintf(buffer,"%u TB / %u TiB", (unsigned)(disk_size/1000/1000/1000/1000), (unsigned)(disk_size/1024/1024/1024/1024));
}
+
+void log_disk_list(list_disk_t *list_disk)
+{
+ list_disk_t *element_disk;
+ /* save disk parameters to rapport */
+ log_info("Hard disk list\n");
+ for(element_disk=list_disk;element_disk!=NULL;element_disk=element_disk->next)
+ {
+ disk_t *disk=element_disk->disk;
+ log_info("%s, sector size=%u", disk->description(disk), disk->sector_size);
+ if(disk->model!=NULL)
+ log_info(" - %s", disk->model);
+ if(disk->serial_no!=NULL)
+ log_info(", S/N:%s", disk->serial_no);
+ if(disk->fw_rev!=NULL)
+ log_info(", FW:%s", disk->fw_rev);
+ log_info("\n");
+ }
+ log_info("\n");
+}