From cdd880924e25640ce972aacb84634bf3dd43853d Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Mon, 28 Dec 2009 21:42:27 +0200 Subject: [PATCH 3/3] add a separate dahdi_ioctl_compat() Add a separate dahdi_ioctl_compat to handle functions whose parameters will need some tweaks. For now, just reject DAHDI_SFCONFIG. --- drivers/dahdi/dahdi-base.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c index 6b90ab3..c445d6e 100644 --- a/drivers/dahdi/dahdi-base.c +++ b/drivers/dahdi/dahdi-base.c @@ -5695,6 +5695,15 @@ unlock_exit: return ret; } +#ifdef HAVE_COMPAT_IOCTL +static long dahdi_ioctl_compat(struct file *file, unsigned int cmd, unsigned long data) +{ + if (cmd == DAHDI_SFCONFIG) { + return -ENOTTY; /* Not supported yet */ + } + return dahdi_ioctl(file, cmd, data); +} +#endif /** * dahdi_register() - unregister a new DAHDI span @@ -8365,7 +8374,7 @@ static struct file_operations dahdi_fops = { #ifdef HAVE_UNLOCKED_IOCTL .unlocked_ioctl = dahdi_ioctl, #ifdef HAVE_COMPAT_IOCTL - .compat_ioctl = dahdi_ioctl, + .compat_ioctl = dahdi_ioctl_compat, #endif #else .ioctl = dahdi_ioctl, -- 1.6.5