summaryrefslogtreecommitdiffstats
path: root/src/dirpart.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2024-07-11 11:05:02 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2024-07-11 11:05:02 +0200
commit2e47fa80833da47c479b6a35fcce47fdc23545d1 (patch)
tree3af3327106a32f9064c99191339c33866d0668d7 /src/dirpart.c
parent63d275a8b072a9ff41000a9a3135ef54dee984f3 (diff)
src/dirpart.c: rework dir_partition_init()HEADmaster
Diffstat (limited to 'src/dirpart.c')
-rw-r--r--src/dirpart.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/dirpart.c b/src/dirpart.c
index 31a9692a..c1164c0e 100644
--- a/src/dirpart.c
+++ b/src/dirpart.c
@@ -52,23 +52,25 @@
static dir_partition_t dir_partition_init(disk_t *disk, const partition_t *partition, const int verbose, const int expert, dir_data_t *dir_data)
{
- dir_partition_t res=DIR_PART_ENOIMP;
if(is_part_fat(partition))
- res=dir_partition_fat_init(disk, partition, dir_data, verbose);
+ {
+ if(dir_partition_fat_init(disk, partition, dir_data, verbose)==DIR_PART_OK)
+ return DIR_PART_OK;
+ }
else if(is_part_ntfs(partition))
{
- res=dir_partition_ntfs_init(disk, partition, dir_data, verbose, expert);
- if(res!=DIR_PART_OK)
- res=dir_partition_exfat_init(disk, partition, dir_data, verbose);
+ if(dir_partition_ntfs_init(disk, partition, dir_data, verbose, expert)==DIR_PART_OK)
+ return DIR_PART_OK;
+ if(dir_partition_exfat_init(disk, partition, dir_data, verbose)==DIR_PART_OK)
+ return DIR_PART_OK;
}
else if(is_part_linux(partition))
{
- res=dir_partition_ext2_init(disk, partition, dir_data, verbose);
- if(res!=DIR_PART_OK)
- res=dir_partition_reiser_init(disk, partition, dir_data, verbose);
+ if(dir_partition_ext2_init(disk, partition, dir_data, verbose)==DIR_PART_OK)
+ return DIR_PART_OK;
+ if(dir_partition_reiser_init(disk, partition, dir_data, verbose)==DIR_PART_OK)
+ return DIR_PART_OK;
}
- if(res==DIR_PART_OK)
- return DIR_PART_OK;
switch(partition->upart_type)
{
case UP_FAT12:
@@ -88,7 +90,7 @@ static dir_partition_t dir_partition_init(disk_t *disk, const partition_t *parti
case UP_EXFAT:
return dir_partition_exfat_init(disk, partition, dir_data, verbose);
default:
- return res;
+ return DIR_PART_ENOIMP;
}
}