From 09ed7d4e50dddbb1ea2e453ccd3c63799fb4c908 Mon Sep 17 00:00:00 2001 From: anton Date: Wed, 15 Sep 2021 04:57:47 +0000 Subject: [PATCH] Change the errno to ENOTTY when encountering an unknown ioctl command as opposed of using EINVAL which is ambiguous in this context. ok deraadt@ --- sys/dev/usb/uhid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c index 883a65cc264..90a75d878e3 100644 --- a/sys/dev/usb/uhid.c +++ b/sys/dev/usb/uhid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhid.c,v 1.86 2021/09/12 06:58:08 anton Exp $ */ +/* $OpenBSD: uhid.c,v 1.87 2021/09/15 04:57:47 anton Exp $ */ /* $NetBSD: uhid.c,v 1.57 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -392,7 +392,7 @@ uhid_do_ioctl(struct uhid_softc *sc, u_long cmd, caddr_t addr, default: rc = uhidev_ioctl(&sc->sc_hdev, cmd, addr, flag, p); if (rc == -1) - rc = EINVAL; + rc = ENOTTY; return rc; } return (0); -- 2.20.1