Currently, it is not necessary to set partno or architecture in
dissect_image_new(), but just for safety.
Preparation for later commits.
.image_name = TAKE_PTR(name),
};
+ for (PartitionDesignator i = 0; i < _PARTITION_DESIGNATOR_MAX; i++)
+ m->partitions[i] = DISSECTED_PARTITION_NULL;
+
*ret = TAKE_PTR(m);
return 0;
}
free(p->decrypted_node);
free(p->mount_options);
- *p = (DissectedPartition) {
- .partno = -1,
- .architecture = _ARCHITECTURE_INVALID,
- };
+ *p = DISSECTED_PARTITION_NULL;
}
#if HAVE_BLKID
uint64_t offset;
};
+#define DISSECTED_PARTITION_NULL \
+ ((DissectedPartition) { \
+ .partno = -1, \
+ .architecture = _ARCHITECTURE_INVALID, \
+ })
+
typedef enum PartitionDesignator {
PARTITION_ROOT,
PARTITION_ROOT_SECONDARY, /* Secondary architecture */