]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsns: report with warnx if a namespace related ioctl fails with ENOSYS
authorMasatake YAMATO <yamato@redhat.com>
Sun, 14 Apr 2024 16:44:38 +0000 (01:44 +0900)
committerKarel Zak <kzak@redhat.com>
Tue, 16 Apr 2024 09:06:29 +0000 (11:06 +0200)
Qemu userspace emulation reports ENOSYS if it doesn't support a given
ioctl command.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
(cherry picked from commit 0a7a8fbc7a82dfbd9e925d1b4d4936bf4e011bc1)

sys-utils/lsns.c

index e68bdbed4687100fa99f5a7269714bfbf710109d..1f3574f99c9a737c1fcebc051064a8e157d80f56 100644 (file)
@@ -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; })