diff mbox

[PATCHv2,1/2] xen/prvicmd: use ENOTTY if the IOCTL is not supported

Message ID 1470323800-9481-2-git-send-email-david.vrabel@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

David Vrabel Aug. 4, 2016, 3:16 p.m. UTC
The standard return value for ioctl(2) where the cmd is not supported
is ENOTTY, not EINVAL.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
---
 drivers/xen/privcmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jürgen Groß Aug. 8, 2016, 10:35 a.m. UTC | #1
On 04/08/16 17:16, David Vrabel wrote:
> The standard return value for ioctl(2) where the cmd is not supported
> is ENOTTY, not EINVAL.
> 
> Signed-off-by: David Vrabel <david.vrabel@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen
diff mbox

Patch

diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index 702040f..ac76bc4 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -572,7 +572,7 @@  static long privcmd_ioctl(struct file *file,
 		break;
 
 	default:
-		ret = -EINVAL;
+		ret = -ENOTTY;
 		break;
 	}