浏览代码

[WATCHDOG] use ENOTTY instead of ENOIOCTLCMD in ioctl()

Return ENOTTY instead of ENOIOCTLCMD in user-visible ioctl() results

The watchdog drivers used to return ENOIOCTLCMD for bad ioctl() commands.
ENOIOCTLCMD should not be visible by the user, so use ENOTTY instead.

Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Wim Van Sebroeck 18 年之前
父节点
当前提交
f311896a99
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      drivers/char/watchdog/iTCO_wdt.c
  2. 1 1
      drivers/char/watchdog/pnx4008_wdt.c

+ 1 - 1
drivers/char/watchdog/iTCO_wdt.c

@@ -494,7 +494,7 @@ static int iTCO_wdt_ioctl (struct inode *inode, struct file *file,
 		}
 
 		default:
-			return -ENOIOCTLCMD;
+			return -ENOTTY;
 	}
 }
 

+ 1 - 1
drivers/char/watchdog/pnx4008_wdt.c

@@ -184,7 +184,7 @@ static int
 pnx4008_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		  unsigned long arg)
 {
-	int ret = -ENOIOCTLCMD;
+	int ret = -ENOTTY;
 	int time;
 
 	switch (cmd) {