summaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2024-07-01 14:25:20 +0200
committerLennart Poettering <lennart@poettering.net>2024-07-01 18:52:57 +0200
commit9fc4388ae4a92ad8ade452da8e6940ca3b80b032 (patch)
tree6d245ed25de83d117809de78d8cf62be6cd4bb74 /src/shared
parentunits: add dep on systemd-logind.service by user@.service (diff)
downloadsystemd-9fc4388ae4a92ad8ade452da8e6940ca3b80b032.tar.xz
systemd-9fc4388ae4a92ad8ade452da8e6940ca3b80b032.zip
mkfs-util: Simplify logic
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/mkfs-util.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/shared/mkfs-util.c b/src/shared/mkfs-util.c
index 14bf82b564..7624989929 100644
--- a/src/shared/mkfs-util.c
+++ b/src/shared/mkfs-util.c
@@ -461,14 +461,9 @@ int make_filesystem(
if (quiet)
stdio_fds[1] = -EBADF;
- if (sector_size > 0) {
- if (strv_extend(&argv, "--sectorsize") < 0)
- return log_oom();
-
- /* mkfs.btrfs expects a sector size of at least 4k bytes. */
- if (strv_extendf(&argv, "%"PRIu64, MAX(sector_size, 4 * U64_KB)) < 0)
- return log_oom();
- }
+ /* mkfs.btrfs expects a sector size of at least 4k bytes. */
+ if (sector_size > 0 && strv_extendf(&argv, "--sectorsize=%"PRIu64, MAX(sector_size, 4 * U64_KB)) < 0)
+ return log_oom();
} else if (streq(fstype, "f2fs")) {
argv = strv_new(mkfs,