[PATCH] ioctl.c: fix the misuse of _IOC_NR

Zhibin Li haoyouab at gmail.com
Sun Jun 30 06:03:10 UTC 2019


* ioctl.c: We should use _IOC_NR(code) instead of _IOC_NR(nr).
---
This looks like a misuse of _IOC_NR. Though it doesn't change the output
at all because the value of _IOC_NR(nr) is the same as _IOC_NR(code). I
guess this is not intended but a typo?
 ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ioctl.c b/ioctl.c
index d3205b22..c2146e07 100644
--- a/ioctl.c
+++ b/ioctl.c
@@ -91,7 +91,7 @@ evdev_decode_number(const unsigned int code)
 		return 1;
 	}
 
-	switch (_IOC_NR(nr)) {
+	switch (_IOC_NR(code)) {
 		case 0x06:
 			tprintf("EVIOCGNAME(%u)", _IOC_SIZE(code));
 			return 1;
-- 
2.21.0



More information about the Strace-devel mailing list