diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-14 19:22:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-14 19:22:58 +0000 |
commit | 764402d8b945f7abbfa5f68a6d16c94c635f7ffe (patch) | |
tree | f04a9feedef2357ee3aa9b9eef439447f76f14c3 /sys-utils/lsns.c | |
parent | Adding debian version 2.40-8. (diff) | |
download | util-linux-764402d8b945f7abbfa5f68a6d16c94c635f7ffe.tar.xz util-linux-764402d8b945f7abbfa5f68a6d16c94c635f7ffe.zip |
Merging upstream version 2.40.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sys-utils/lsns.c')
-rw-r--r-- | sys-utils/lsns.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/sys-utils/lsns.c b/sys-utils/lsns.c index e68bdbe..6c87c47 100644 --- a/sys-utils/lsns.c +++ b/sys-utils/lsns.c @@ -68,7 +68,7 @@ UL_DEBUG_DEFINE_MASKNAMES(lsns) = UL_DEBUG_EMPTY_MASKNAMES; #define lsns_ioctl(fildes, request, ...) __extension__ ({ \ int ret = ioctl(fildes, request, ##__VA_ARGS__); \ - if (ret == -1 && errno == ENOTTY) \ + if (ret == -1 && (errno == ENOTTY || errno == ENOSYS)) \ warnx("Unsupported ioctl %s", #request); \ ret; }) @@ -308,7 +308,11 @@ static int get_ns_ino(int dir, const char *nsname, ino_t *ino, ino_t *pino, ino_ return -errno; if (strcmp(nsname, "pid") == 0 || strcmp(nsname, "user") == 0) { if ((pfd = lsns_ioctl(fd, NS_GET_PARENT)) < 0) { - if (errno == EPERM) + if (errno == EPERM + /* On the test platforms, "build (qemu-user, s390x)" and + * "build (qemu-user, riscv64)", the ioctl reported ENOSYS. + */ + || errno == ENOSYS) goto user; close(fd); return -errno; @@ -323,7 +327,11 @@ static int get_ns_ino(int dir, const char *nsname, ino_t *ino, ino_t *pino, ino_ } user: if ((ofd = lsns_ioctl(fd, NS_GET_USERNS)) < 0) { - if (errno == EPERM) + if (errno == EPERM + /* On the test platforms, "build (qemu-user, s390x)" and + * "build (qemu-user, riscv64)", the ioctl reported ENOSYS. + */ + || errno == ENOSYS) goto out; close(fd); return -errno; @@ -785,6 +793,9 @@ static void interpolate_missing_namespaces(struct lsns *ls, struct lsns_namespac int fd_orphan, fd_missing; struct stat st; + if (!orphan->proc) + return; + orphan->related_ns[rela] = get_namespace(ls, orphan->related_id[rela]); if (orphan->related_ns[rela]) return; |