diff options
author | Lennart Poettering <lennart@poettering.net> | 2024-11-21 12:16:57 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-11-23 09:33:06 +0100 |
commit | 2bd290ca026860aae71fcb8f45f3dbb07a84d928 (patch) | |
tree | 156ae13cc76a73f016cc3c00dc88182cf9601bc4 /src | |
parent | shutdown: propagate one more error from sync_making_progress() (diff) | |
download | systemd-2bd290ca026860aae71fcb8f45f3dbb07a84d928.tar.xz systemd-2bd290ca026860aae71fcb8f45f3dbb07a84d928.zip |
nspawn: fix userns_mkdir() invocation
The wrong error code was logged.
But actually given that userns_mkdir() is fine with existing dirs, let's
drop the redundant conditionalization.
Follow-up for: a1fcaa1549d86098d0ba75254b6afc96c786b3b6
Diffstat (limited to 'src')
-rw-r--r-- | src/nspawn/nspawn.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 5dd289c1b4..0a8f1af821 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -2280,10 +2280,9 @@ static int copy_devnode_one(const char *dest, const char *node, bool ignore_mkno r = path_extract_directory(from, &parent); if (r < 0) return log_error_errno(r, "Failed to extract directory from %s: %m", from); - if (!path_equal(parent, "/dev/")) { - if (userns_mkdir(dest, parent, 0755, 0, 0) < 0) - return log_error_errno(r, "Failed to create directory %s: %m", parent); - } + r = userns_mkdir(dest, parent, 0755, 0, 0); + if (r < 0) + return log_error_errno(r, "Failed to create directory %s: %m", parent); if (mknod(to, st.st_mode, st.st_rdev) < 0) { r = -errno; /* Save the original error code. */ |