diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2023-08-14 10:27:57 +0200 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2023-08-14 10:27:57 +0200 |
commit | fd9fe57a266942c96e136d23dc032e3d20fc5019 (patch) | |
tree | 6938ff2b1bc42876baeb7277c99c6e0ef7947759 /src/home | |
parent | Merge pull request #28827 from gioele/docs-fix-network-online-example-unit (diff) | |
download | systemd-fd9fe57a266942c96e136d23dc032e3d20fc5019.tar.xz systemd-fd9fe57a266942c96e136d23dc032e3d20fc5019.zip |
fdisk-util: Make fdisk_new_context_fd() more generic
Let's make this an openat() style function so we can also pass a
device path.
Diffstat (limited to 'src/home')
-rw-r--r-- | src/home/homework-luks.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/home/homework-luks.c b/src/home/homework-luks.c index 7f23d1e158..5920fbb732 100644 --- a/src/home/homework-luks.c +++ b/src/home/homework-luks.c @@ -1870,7 +1870,7 @@ static int make_partition_table( if (r < 0) return log_error_errno(r, "Failed to initialize partition type: %m"); - r = fdisk_new_context_fd(fd, /* read_only= */ false, sector_size, &c); + r = fdisk_new_context_at(fd, /* path= */ NULL, /* read_only= */ false, sector_size, &c); if (r < 0) return log_error_errno(r, "Failed to open device: %m"); @@ -2698,7 +2698,7 @@ static int prepare_resize_partition( return 0; } - r = fdisk_new_context_fd(fd, /* read_only= */ false, UINT32_MAX, &c); + r = fdisk_new_context_at(fd, /* path= */ NULL, /* read_only= */ false, UINT32_MAX, &c); if (r < 0) return log_error_errno(r, "Failed to open device: %m"); @@ -2855,7 +2855,7 @@ static int apply_resize_partition( if ((size_t) n != ssz * 2) return log_error_errno(SYNTHETIC_ERRNO(EIO), "Short write while wiping partition table."); - r = fdisk_new_context_fd(fd, /* read_only= */ false, ssz, &c); + r = fdisk_new_context_at(fd, /* path= */ NULL, /* read_only= */ false, ssz, &c); if (r < 0) return log_error_errno(r, "Failed to open device: %m"); |