Commit 795b89d2 authored by Samuel Tardieu's avatar Samuel Tardieu Committed by Wim Van Sebroeck
Browse files

[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: default avatarSamuel Tardieu <sam@rfc1149.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
Acked-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
parent 25ff3780
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -183,7 +183,7 @@ static int acq_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
	}

	default:
	  return -ENOIOCTLCMD;
	  return -ENOTTY;
	}
}

+1 −1
Original line number Diff line number Diff line
@@ -176,7 +176,7 @@ advwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
	}

	default:
	  return -ENOIOCTLCMD;
	  return -ENOTTY;
	}
	return 0;
}
+1 −1
Original line number Diff line number Diff line
@@ -236,7 +236,7 @@ static int ali_ioctl(struct inode *inode, struct file *file,
			return put_user(timeout, p);

		default:
			return -ENOIOCTLCMD;
			return -ENOTTY;
	}
}

+1 −1
Original line number Diff line number Diff line
@@ -277,7 +277,7 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
		case WDIOC_GETTIMEOUT:
			return put_user(timeout, p);
		default:
			return -ENOIOCTLCMD;
			return -ENOTTY;
	}
}

+1 −1
Original line number Diff line number Diff line
@@ -168,7 +168,7 @@ static int at91_wdt_ioctl(struct inode *inode, struct file *file,
			return 0;

		default:
			return -ENOIOCTLCMD;
			return -ENOTTY;
	}
}

Loading