diff options
author | Lennart Poettering <lennart@poettering.net> | 2022-11-29 11:54:22 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2022-11-29 12:07:15 +0100 |
commit | 02e32aa62958eb49d97540985f95bd79b2f59ccc (patch) | |
tree | 0c415507c7c3a4b429723d126a97009c2951ecbf /src/sysupdate | |
parent | kernel-install: Add uki layout (diff) | |
download | systemd-02e32aa62958eb49d97540985f95bd79b2f59ccc.tar.xz systemd-02e32aa62958eb49d97540985f95bd79b2f59ccc.zip |
fdisk-util: add fdisk_partition_get_uuid_as_id128() helper
Inspired by: #25534
Diffstat (limited to 'src/sysupdate')
-rw-r--r-- | src/sysupdate/sysupdate-partition.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/sysupdate/sysupdate-partition.c b/src/sysupdate/sysupdate-partition.c index 33d0e584ba..486f9f19dd 100644 --- a/src/sysupdate/sysupdate-partition.c +++ b/src/sysupdate/sysupdate-partition.c @@ -106,7 +106,7 @@ int read_partition_info( PartitionInfo *ret) { _cleanup_free_ char *label_copy = NULL, *device = NULL; - const char *pts, *ids, *label; + const char *pts, *label; struct fdisk_partition *p; struct fdisk_parttype *pt; uint64_t start, size, flags; @@ -159,13 +159,9 @@ int read_partition_info( if (r < 0) return log_error_errno(r, "Failed to parse partition type UUID %s: %m", pts); - ids = fdisk_partition_get_uuid(p); - if (!ids) - return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Found a partition without a UUID."); - - r = sd_id128_from_string(ids, &id); + r = fdisk_partition_get_uuid_as_id128(p, &id); if (r < 0) - return log_error_errno(r, "Failed to parse partition UUID %s: %m", ids); + return log_error_errno(r, "Failed to read partition UUID: %m"); r = fdisk_partition_get_attrs_as_uint64(p, &flags); if (r < 0) |