summaryrefslogtreecommitdiffstats
path: root/src/gfs2.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2016-01-23 10:10:04 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2016-01-23 10:10:04 +0100
commitc5fa1e875a8cf03c6e4fe59fa791cad3c9ee1379 (patch)
tree0137aed0fd481accd0901f2ab2c53ee6b85bab8c /src/gfs2.c
parent87bd90afb8ce75710e31255ab4134f6493a9745e (diff)
New prototype for test_gfs2()
Diffstat (limited to 'src/gfs2.c')
-rw-r--r--src/gfs2.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/gfs2.c b/src/gfs2.c
index 42c3f6b..e710dd2 100644
--- a/src/gfs2.c
+++ b/src/gfs2.c
@@ -34,19 +34,20 @@
#include "fnctdsk.h"
#include "log.h"
-static int set_gfs2_info(const struct gfs2_sb *sb, partition_t *partition)
+static void set_gfs2_info(partition_t *partition)
{
+ partition->upart_type=UP_GFS2;
partition->info[0]='\0';
- return 0;
}
-static int test_gfs2(disk_t *disk, const struct gfs2_sb *sb, partition_t *partition, const int dump_ind)
+static int test_gfs2(disk_t *disk, const struct gfs2_sb *sb, const partition_t *partition, const int dump_ind)
{
if(sb->sb_header.mh_magic != be32(GFS2_MAGIC))
return 1;
if(sb->sb_header.mh_format != be32(GFS2_FORMAT_SB))
return 1;
- partition->upart_type=UP_GFS2;
+ if(partition==NULL)
+ return 0;
if(dump_ind!=0)
{
log_info("\ngfs2 magic value at %u/%u/%u\n",
@@ -72,7 +73,7 @@ int check_gfs2(disk_t *disk, partition_t *partition)
free(buffer);
return 1;
}
- set_gfs2_info((const struct gfs2_sb *)buffer, partition);
+ set_gfs2_info(partition);
free(buffer);
return 0;
}
@@ -81,10 +82,8 @@ int recover_gfs2(disk_t *disk, const struct gfs2_sb *sb, partition_t *partition,
{
if(test_gfs2(disk,sb,partition,dump_ind)!=0)
return 1;
- set_gfs2_info(sb, partition);
+ set_gfs2_info(partition);
partition->part_size=disk->sector_size;
partition->part_type_i386=(unsigned char)P_LINUX;
return 0;
}
-
-