tree-wide: add short comments for namespace_open() and namespace_enter()

Also use -EBADF when unspecified.
This commit is contained in:
Yu Watanabe
2024-01-19 15:06:08 +09:00
parent 5178d4a77e
commit d2881ef96e
10 changed files with 88 additions and 23 deletions
+6 -1
View File
@@ -243,7 +243,12 @@ int userns_acquire(const char *uid_map, const char *gid_map) {
if (r < 0)
return log_error_errno(r, "Failed to write GID map: %m");
r = namespace_open(pid, NULL, NULL, NULL, &userns_fd, NULL);
r = namespace_open(pid,
/* ret_pidns_fd = */ NULL,
/* ret_mntns_fd = */ NULL,
/* ret_netns_fd = */ NULL,
&userns_fd,
/* ret_root_fd = */ NULL);
if (r < 0)
return log_error_errno(r, "Failed to open userns fd: %m");