diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2023-08-14 10:42:43 +0200 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2023-08-14 10:42:43 +0200 |
commit | 4492eb118678de1783a38e132f6a44f68d39d1d0 (patch) | |
tree | 6ba8a8df5c402406df5447c074d2e220f644d24a /src/home | |
parent | fdisk-util: Make fdisk_new_context_fd() more generic (diff) | |
download | systemd-4492eb118678de1783a38e132f6a44f68d39d1d0.tar.xz systemd-4492eb118678de1783a38e132f6a44f68d39d1d0.zip |
tree-wide: Use fdisk_new_context_at() more
Diffstat (limited to 'src/home')
-rw-r--r-- | src/home/homework-luks.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/home/homework-luks.c b/src/home/homework-luks.c index 5920fbb732..e41920ce9c 100644 --- a/src/home/homework-luks.c +++ b/src/home/homework-luks.c @@ -2764,13 +2764,9 @@ static int get_maximum_partition_size( assert(p); assert(ret_maximum_partition_size); - c = fdisk_new_context(); - if (!c) - return log_oom(); - - r = fdisk_assign_device(c, FORMAT_PROC_FD_PATH(fd), 0); + r = fdisk_new_context_at(fd, /* path= */ NULL, /* read_only= */ true, /* sector_size= */ UINT32_MAX, &c); if (r < 0) - return log_error_errno(r, "Failed to open device: %m"); + return log_error_errno(r, "Failed to create fdisk context: %m"); start_lba = fdisk_partition_get_start(p); assert(start_lba <= UINT64_MAX/512); |