From: Masatake YAMATO Date: Sun, 14 Apr 2024 16:44:38 +0000 (+0900) Subject: lsns: report with warnx if a namespace related ioctl fails with ENOSYS X-Git-Tag: v2.40.1-rc1~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=532bd55ff160cdb16f2a871ce81be00bfa63d62a;p=thirdparty%2Futil-linux.git lsns: report with warnx if a namespace related ioctl fails with ENOSYS Qemu userspace emulation reports ENOSYS if it doesn't support a given ioctl command. Signed-off-by: Masatake YAMATO (cherry picked from commit 0a7a8fbc7a82dfbd9e925d1b4d4936bf4e011bc1) --- diff --git a/sys-utils/lsns.c b/sys-utils/lsns.c index e68bdbed4..1f3574f99 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; })