diff options
| author | Ben Collins <bcollins@debian.org> | 2003-05-03 21:03:34 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2003-05-03 21:03:34 -0700 |
| commit | 4c3c3a2174e119f12ccffed953b547739ea64b45 (patch) | |
| tree | 9d33a603da70f0f5996a2c10af3dafdb5c23abd4 | |
| parent | e515904b3ed07ee2f231cad7ffbe7bd315f41486 (diff) | |
[PATCH] Fix compat_ioctl
This fixes the compat_ioctl interface for the case where a NULL handler
is registered. This should produce a "compatible" as opposed to
"translated" interface for the specified ioctl. The patch was sent to
linux-kernel and no one complained (atleast with this second rev).
| -rw-r--r-- | fs/compat.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/compat.c b/fs/compat.c index 4a301f7dd9ba..1a834ba4d1a3 100644 --- a/fs/compat.c +++ b/fs/compat.c @@ -300,7 +300,6 @@ asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, unsigned lon { struct file * filp; int error = -EBADF; - int (*handler)(unsigned int, unsigned int, unsigned long, struct file * filp); struct ioctl_trans *t; filp = fget(fd); @@ -317,8 +316,10 @@ asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, unsigned lon while (t && t->cmd != cmd) t = (struct ioctl_trans *)t->next; if (t) { - handler = t->handler; - error = handler(fd, cmd, arg, filp); + if (t->handler) + error = t->handler(fd, cmd, arg, filp); + else + error = sys_ioctl(fd, cmd, arg); } else if (cmd >= SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE + 15)) { error = siocdevprivate_ioctl(fd, cmd, arg); } else { |
