mirror of
https://github.com/systemd/systemd.git
synced 2026-11-07 22:07:14 +00:00
mkfs-util: fix error reporting in the mkfs child
`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 "°". (cherry picked from commit6d51f6eb04) (cherry picked from commitf2abf9c66e) (cherry picked from commitc275a1affb) (cherry picked from commit52c033c3b1)
This commit is contained in:
1 parent
f3db59e543
commit
f5ee066986
1 file changed
+2
-2
@@ -704,14 +704,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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user