]> granicus.if.org Git - strace/commitdiff
Return 0 instead of 1 on entering path of ioctl decoders
authorEugene Syromyatnikov <evgsyr@gmail.com>
Sat, 26 Aug 2017 22:18:27 +0000 (00:18 +0200)
committerEugene Syromyatnikov <evgsyr@gmail.com>
Mon, 28 Aug 2017 00:33:20 +0000 (02:33 +0200)
As returning 1 (without RVAL_DECODED) on entering makes no sense.

* block.c (block_ioctl) <case BLKTRACESETUP>: Replace return 1 with
return 0 on entering path.
* ptp.c (ptp_ioctl) <case PTP_SYS_OFFSET>: Likewise.
* sg_io_v3.c (decode_request): Likewise.
* sg_io_v4.c (decode_request): Likewise.
* sock.c (decode)ifconf, sock_ioctl) <case SIOCGIFMAP>: Likewise.
* ubi.c (ubi_ioctl) <case UBI_IOCMKVOL, case UBI_IOCATT>: Likewise.
* v4l2.c (print_v4l2_ext_controls): Likewise.

Co-authored-by: Dmitry V. Levin <ldv@altlinux.org>
block.c
ptp.c
sg_io_v3.c
sg_io_v4.c
sock.c
ubi.c
v4l2.c

diff --git a/block.c b/block.c
index 99b76dac73f59d0abb4402c2ccf96a7f255a14bd..486c6df01214ae062ab8e726968796ae0e9bee99 100644 (file)
--- a/block.c
+++ b/block.c
@@ -244,7 +244,7 @@ MPERS_PRINTER_DECL(int, block_ioctl, struct tcb *const tcp,
                        PRINT_FIELD_U(", ", buts, start_lba);
                        PRINT_FIELD_U(", ", buts, end_lba);
                        PRINT_FIELD_U(", ", buts, pid);
-                       return 1;
+                       return 0;
                } else {
                        struct_blk_user_trace_setup buts;
 
diff --git a/ptp.c b/ptp.c
index 6a8a9d268568ff57e169ae6ee0e9a31ea0152ae9..6d3ddd8ac6ceaa576577d6ca563c2360a1296cdd 100644 (file)
--- a/ptp.c
+++ b/ptp.c
@@ -85,7 +85,7 @@ ptp_ioctl(struct tcb *const tcp, const unsigned int code,
                                break;
 
                        tprintf("{n_samples=%u", sysoff.n_samples);
-                       return 1;
+                       return 0;
                } else {
                        unsigned int n_samples, i;
 
index f31fb03468d71fcf52808dad9c8d7ac5f48b8b53..ebeb66c4979a8db66c99087c5da81e8aec98a698 100644 (file)
@@ -103,7 +103,7 @@ decode_request(struct tcb *const tcp, const kernel_ulong_t arg)
                set_tcb_priv_data(tcp, entering_sg_io, free);
        }
 
-       return 1;
+       return 0;
 }
 
 static int
index f4a69255b4251fc3d6b938c8da96023b2c1445b3..68a5cbc897b75101680c64ec862377008bb977dc 100644 (file)
@@ -97,7 +97,7 @@ decode_request(struct tcb *const tcp, const kernel_ulong_t arg)
                set_tcb_priv_data(tcp, entering_sg_io, free);
        }
 
-       return 1;
+       return 0;
 }
 
 static int
diff --git a/sock.c b/sock.c
index e6d63c0b8410f9f58abbaf18c481acb5d29363f9..c6bb65520a556b440761ec180b99d557f3c6ed05 100644 (file)
--- a/sock.c
+++ b/sock.c
@@ -208,7 +208,7 @@ decode_ifconf(struct tcb *const tcp, const kernel_ulong_t addr)
 
                set_tcb_priv_data(tcp, ifc, free);
 
-               return 1;
+               return 0;
        }
 
        /* exiting */
@@ -344,7 +344,7 @@ MPERS_PRINTER_DECL(int, sock_ioctl,
                                tprints("{ifr_name=");
                                print_ifname(ifr.ifr_name);
                        }
-                       return 1;
+                       return 0;
                } else {
                        if (syserror(tcp)) {
                                tprints("}");
diff --git a/ubi.c b/ubi.c
index 9fa41e1c08b94cd4605dc43687e2104f5dbd1563..6611bd46cd21218f3fdf759913b7d3ad4ea2ba12 100644 (file)
--- a/ubi.c
+++ b/ubi.c
@@ -67,7 +67,7 @@ ubi_ioctl(struct tcb *const tcp, const unsigned int code,
                                        CLAMP(mkvol.name_len, 0,
                                              UBI_MAX_VOLUME_NAME));
                        tprints("}");
-                       return 1;
+                       return 0;
                }
                if (!syserror(tcp)) {
                        tprints(" => ");
@@ -135,7 +135,7 @@ ubi_ioctl(struct tcb *const tcp, const unsigned int code,
                                ", max_beb_per1024=%" PRIi16 "}",
                                attach.ubi_num, attach.mtd_num,
                                attach.vid_hdr_offset, attach.max_beb_per1024);
-                       return 1;
+                       return 0;
                }
                if (!syserror(tcp)) {
                        tprints(" => ");
diff --git a/v4l2.c b/v4l2.c
index 43d6c6e6fc5862bd144496779772c92d85d5b06b..6f5f6bff4d29b1001319987d89bb58c3cb587368 100644 (file)
--- a/v4l2.c
+++ b/v4l2.c
@@ -825,7 +825,9 @@ print_v4l2_ext_controls(struct tcb *const tcp, const kernel_ulong_t arg,
                tprints("}");
                return RVAL_DECODED | 1;
        }
-       return 1;
+
+       /* entering */
+       return 0;
 }
 #endif /* VIDIOC_S_EXT_CTRLS */