From: Ian Abbott Date: Wed, 7 Nov 2007 16:18:28 +0000 (+0000) Subject: Make sure 32-bit ioctl handler for <= 2.6.10 kernel doesn't return X-Git-Tag: v0_7_76~93 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=c5c54eafe5a319c4eef8e61cf9ebb0b5b418dd65;p=comedi.git Make sure 32-bit ioctl handler for <= 2.6.10 kernel doesn't return -ENOIOCTLCMD. --- diff --git a/comedi/comedi_compat32.c b/comedi/comedi_compat32.c index 89ce85d9..eeee4469 100644 --- a/comedi/comedi_compat32.c +++ b/comedi/comedi_compat32.c @@ -493,11 +493,17 @@ long comedi_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) static int mapped_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg, struct file *file) { + int rc; + /* Make sure we are dealing with a Comedi device. */ if (imajor(file->f_dentry->d_inode) != COMEDI_MAJOR) { return -ENOTTY; } - return (int)comedi_compat_ioctl(file, cmd, arg); + rc = (int)comedi_compat_ioctl(file, cmd, arg); + if (rc == -ENOIOCTLCMD) { + rc = -ENOTTY; + } + return rc; } struct ioctl32_map {