summaryrefslogtreecommitdiffstats
path: root/src/vmfs.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2016-01-23 10:25:44 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2016-01-23 10:25:44 +0100
commitb07d180c499d3378a8c05b38b3df2ef9a87e7fcb (patch)
treed1ca322febb2e848803a24e341d8a46c63c1e7b2 /src/vmfs.c
parent0b0cc2cf4ca277f09a153108b947239ef98b6b54 (diff)
New prototype for test_VMFS()
Diffstat (limited to 'src/vmfs.c')
-rw-r--r--src/vmfs.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/vmfs.c b/src/vmfs.c
index f0ec308..73d1488 100644
--- a/src/vmfs.c
+++ b/src/vmfs.c
@@ -35,8 +35,8 @@
#include "log.h"
#include "vmfs.h"
-static int test_VMFS(disk_t *disk, const struct vmfs_volume *sb, partition_t *partition, const int dump_ind);
-static int set_VMFS_info(const struct vmfs_volume *sb, partition_t *partition);
+static int test_VMFS(disk_t *disk, const struct vmfs_volume *sb, const partition_t *partition, const int dump_ind);
+static void set_VMFS_info(const struct vmfs_volume *sb, partition_t *partition);
int check_VMFS(disk_t *disk,partition_t *partition)
{
@@ -56,10 +56,10 @@ int check_VMFS(disk_t *disk,partition_t *partition)
return 0;
}
-static int set_VMFS_info(const struct vmfs_volume *sb, partition_t *partition)
+static void set_VMFS_info(const struct vmfs_volume *sb, partition_t *partition)
{
+ partition->upart_type=UP_VMFS;
sprintf(partition->info,"VMFS %lu", (long unsigned)le32(sb->version));
- return 0;
}
int recover_VMFS(disk_t *disk, const struct vmfs_volume *sb, partition_t *partition, const int verbose, const int dump_ind)
@@ -82,7 +82,7 @@ int recover_VMFS(disk_t *disk, const struct vmfs_volume *sb, partition_t *partit
return 0;
}
-static int test_VMFS(disk_t *disk, const struct vmfs_volume *sb, partition_t *partition, const int dump_ind)
+static int test_VMFS(disk_t *disk, const struct vmfs_volume *sb, const partition_t *partition, const int dump_ind)
{
if(le32(sb->magic)!=0xc001d00d || le32(sb->version)>20)
return 1;
@@ -95,8 +95,5 @@ static int test_VMFS(disk_t *disk, const struct vmfs_volume *sb, partition_t *pa
offset2sector(disk,partition->part_offset));
dump_log(sb,DEFAULT_SECTOR_SIZE);
}
- if(partition==NULL)
- return 0;
- partition->upart_type=UP_VMFS;
return 0;
}