various: use id128_from_string_not_null()

No functional change. In config_parse_address_generation_type() we would set
the output parameter and then say it's ignored, so it _looked_ like an error in
the code, but the variable was always initialized to SD_ID128_NULL anyway, so
the code was actually fine.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2023-09-02 14:16:25 +03:00
parent 7c9de5d85d
commit aea3f594db
5 changed files with 19 additions and 46 deletions
+4 -6
View File
@@ -2438,11 +2438,8 @@ static int context_load_partition_table(Context *context) {
if (r < 0)
return log_error_errno(r, "Failed to get current GPT disk label UUID: %m");
r = sd_id128_from_string(disk_uuid_string, &disk_uuid);
if (r < 0)
return log_error_errno(r, "Failed to parse current GPT disk label UUID: %m");
if (sd_id128_is_null(disk_uuid)) {
r = id128_from_string_nonzero(disk_uuid_string, &disk_uuid);
if (r == -ENXIO) {
r = derive_uuid(context->seed, "disk-uuid", &disk_uuid);
if (r < 0)
return log_error_errno(r, "Failed to acquire disk GPT uuid: %m");
@@ -2450,7 +2447,8 @@ static int context_load_partition_table(Context *context) {
r = fdisk_set_disklabel_id(c);
if (r < 0)
return log_error_errno(r, "Failed to set GPT disk label: %m");
}
} else if (r < 0)
return log_error_errno(r, "Failed to parse current GPT disk label UUID: %m");
r = fdisk_get_partitions(c, &t);
if (r < 0)