From fb54db2c34e8ccde64eacc73ea55afa5e15d9e82 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Tue, 23 Feb 2021 18:59:07 +0100 Subject: [PATCH] attach: fix unsupported namespaces Signed-off-by: Christian Brauner --- src/lxc/attach.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lxc/attach.c b/src/lxc/attach.c index 7bc6db120..200a106c4 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -513,7 +513,7 @@ static int same_ns(int dfd_pid1, int dfd_pid2, const char *ns_path) if (ns_fd2 < 0) { /* The kernel does not support this namespace. This is not an error. */ if (errno == ENOENT) - return -EINVAL; + return -ENOENT; return log_error_errno(-errno, errno, "Failed to open %d(%s)", dfd_pid2, ns_path); } @@ -573,7 +573,7 @@ static int __prepare_namespaces_nsfd(struct attach_context *ctx, if (ctx->ns_fd[i] >= 0) continue; - if (ctx->ns_fd[i] == -EINVAL) { + if (ctx->ns_fd[i] == -ENOENT) { ctx->ns_inherited &= ~ns_info[i].clone_flag; continue; } -- 2.47.2