From 6d51f6eb049dfcf3b2747036395601fcd8f6b019 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Fri, 28 Aug 2026 04:27:16 +0000 Subject: [PATCH] mkfs-util: fix error reporting in the mkfs child MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `r` at that point holds the return value of `pidref_safe_fork_full()`, which is 0 in the child, so a failing `setenv()` was reported as "Success". Also, fix a stray "°". --- src/shared/mkfs-util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/mkfs-util.c b/src/shared/mkfs-util.c index a197eb28ce..35955eb00b 100644 --- a/src/shared/mkfs-util.c +++ b/src/shared/mkfs-util.c @@ -671,14 +671,14 @@ int make_filesystem( STRV_FOREACH_PAIR(k, v, env) if (setenv(*k, *v, /* replace= */ true) < 0) { - log_error_errno(r, "Failed to set %s=%s environment variable: %m", *k, *v); + log_error_errno(errno, "Failed to set %s=%s environment variable: %m", *k, *v); _exit(EXIT_FAILURE); } /* mkfs.btrfs refuses to operate on block devices with mounted partitions, even if operating * on unformatted free space, so let's trick it and other mkfs tools into thinking no * partitions are mounted. See https://github.com/kdave/btrfs-progs/issues/640 for more - ° information. */ + * information. */ if (fork_flags & FORK_NEW_MOUNTNS) (void) mount_nofollow_verbose(LOG_DEBUG, "/dev/null", "/proc/self/mounts", NULL, MS_BIND, NULL);