mirror of
https://github.com/systemd/systemd.git
synced 2025-02-25 21:57:32 +03:00
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
This commit is contained in:
parent
1e9fb1d456
commit
2bd290ca02
@ -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. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user