]> 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)
committerMasatake YAMATO <yamato@redhat.com>
Sun, 14 Apr 2024 17:06:53 +0000 (02:06 +0900)
Qemu userspace emulation reports ENOSYS if it doesn't support a given
ioctl command.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
sys-utils/lsns.c

index 0ab5e26a3079f743c5f2cc4474e95eb48ad2b85b..67a563ebc3251f45bf9c9e928ba21ba625b35de3 100644 (file)
@@ -70,7 +70,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; })