]> granicus.if.org Git - strace/commitdiff
evdev.c: decode all directions except _IOC_READ on entering syscall
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 27 May 2016 00:40:02 +0000 (00:40 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 28 May 2016 00:37:05 +0000 (00:37 +0000)
* evdev.c (evdev_write_ioctl): Remove exiting check.
(evdev_read_ioctl): Move entering check ...
(evdev_ioctl): ... here.  Add RVAL_DECODED to return code in _IOC_WRITE
and default cases.

evdev.c

diff --git a/evdev.c b/evdev.c
index 1bd9c88b784e8192985123b1059450e1bdffbd6f..dd068a86d017436974dc41ba098a403292d24bd6 100644 (file)
--- a/evdev.c
+++ b/evdev.c
@@ -310,9 +310,6 @@ repeat_ioctl(struct tcb *tcp, long arg)
 static int
 evdev_read_ioctl(struct tcb *tcp, const unsigned int code, long arg)
 {
-       if (entering(tcp))
-               return 1;
-
        if (syserror(tcp))
                return 0;
 
@@ -425,9 +422,6 @@ evdev_read_ioctl(struct tcb *tcp, const unsigned int code, long arg)
 static int
 evdev_write_ioctl(struct tcb *tcp, const unsigned int code, long arg)
 {
-       if (exiting(tcp))
-               return 1;
-
        if ((_IOC_NR(code) & ~ABS_MAX) == _IOC_NR(EVIOCSABS(0)))
                return abs_ioctl(tcp, arg);
 
@@ -465,13 +459,13 @@ evdev_ioctl(struct tcb *tcp, const unsigned int code, long arg)
 {
        switch(_IOC_DIR(code)) {
                case _IOC_READ:
+                       if (entering(tcp))
+                               return 0;
                        return evdev_read_ioctl(tcp, code, arg);
                case _IOC_WRITE:
-                       if (!evdev_write_ioctl(tcp, code, arg))
-                               tprintf(", %lx", arg);
-                       return 1;
+                       return evdev_write_ioctl(tcp, code, arg) | RVAL_DECODED;
                default:
-                       return 0;
+                       return RVAL_DECODED;
        }
 }