ioctl: prepare ioctl_decode_command_number for future changes
* ioctl.c (ioctl_decode_command_number): Change 1st arg to struct tcb*.
(sys_ioctl): Update callers.
diff --git a/ioctl.c b/ioctl.c
index 305d27d..d10e45d 100644
--- a/ioctl.c
+++ b/ioctl.c
@@ -182,8 +182,10 @@
}
static int
-ioctl_decode_command_number(const unsigned int code)
+ioctl_decode_command_number(struct tcb *tcp)
{
+ const unsigned int code = tcp->u_arg[1];
+
switch (_IOC_TYPE(code)) {
case 'E':
return evdev_decode_number(code);
@@ -274,7 +276,7 @@
if (entering(tcp)) {
printfd(tcp, tcp->u_arg[0]);
tprints(", ");
- if (!ioctl_decode_command_number(tcp->u_arg[1])) {
+ if (!ioctl_decode_command_number(tcp)) {
iop = ioctl_lookup(tcp->u_arg[1]);
if (iop) {
tprints(iop->symbol);