attach: fix unsupported namespaces

parent 254a22e1
...@@ -513,7 +513,7 @@ static int same_ns(int dfd_pid1, int dfd_pid2, const char *ns_path) ...@@ -513,7 +513,7 @@ static int same_ns(int dfd_pid1, int dfd_pid2, const char *ns_path)
if (ns_fd2 < 0) { if (ns_fd2 < 0) {
/* The kernel does not support this namespace. This is not an error. */ /* The kernel does not support this namespace. This is not an error. */
if (errno == ENOENT) if (errno == ENOENT)
return -EINVAL; return -ENOENT;
return log_error_errno(-errno, errno, "Failed to open %d(%s)", return log_error_errno(-errno, errno, "Failed to open %d(%s)",
dfd_pid2, ns_path); dfd_pid2, ns_path);
} }
...@@ -573,7 +573,7 @@ static int __prepare_namespaces_nsfd(struct attach_context *ctx, ...@@ -573,7 +573,7 @@ static int __prepare_namespaces_nsfd(struct attach_context *ctx,
if (ctx->ns_fd[i] >= 0) if (ctx->ns_fd[i] >= 0)
continue; continue;
if (ctx->ns_fd[i] == -EINVAL) { if (ctx->ns_fd[i] == -ENOENT) {
ctx->ns_inherited &= ~ns_info[i].clone_flag; ctx->ns_inherited &= ~ns_info[i].clone_flag;
continue; continue;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment