]> granicus.if.org Git - strace/commitdiff
ipc: fix printing of integer arguments
authorEugene Syromyatnikov <evgsyr@gmail.com>
Wed, 7 Sep 2016 12:41:17 +0000 (15:41 +0300)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 8 Sep 2016 16:40:50 +0000 (16:40 +0000)
* ipc_msgctl.c (SYS_FUNC(msgctl)): As msqid argument is treated as int
by the kernel, cast it to int and print it using %d format.
* ipc_sem.c (SYS_FUNC(semop), SYS_FUNC(semtimedop)): Likewise,
for semid argument.
(SYS_FUNC(semget)): Likewise, for nsems argument.
(SYS_FUNC(semctl)): Likewise, for semid and semnum arguments.
* ipc_shm.c (SYS_FUNC(shmat)): Likewise, for shmid argument.
* ipc_shmctl.c (SYS_FUNC(shmctl)): Likewise.

ipc_msgctl.c
ipc_sem.c
ipc_shm.c
ipc_shmctl.c

index 9be35cefabadcc0ca5b422153aa53e7212d9eb35..a7352cb9a301f412d4dde0b53e3fa08fe3ee9910 100644 (file)
@@ -97,7 +97,7 @@ print_msqid_ds(struct tcb *tcp, const long addr, int cmd)
 SYS_FUNC(msgctl)
 {
        if (entering(tcp)) {
-               tprintf("%lu, ", tcp->u_arg[0]);
+               tprintf("%d, ", (int) tcp->u_arg[0]);
                PRINTCTL(msgctl_flags, tcp->u_arg[1], "MSG_???");
                tprints(", ");
        } else {
index abcfa857f279d5bf9e6fedb2e13a8ec4d358440d..4725a170176a0a0191388eb1461627f0488aeba3 100644 (file)
--- a/ipc_sem.c
+++ b/ipc_sem.c
@@ -71,7 +71,7 @@ tprint_sembuf_array(struct tcb *tcp, const long addr, const unsigned long count)
 
 SYS_FUNC(semop)
 {
-       tprintf("%lu, ", tcp->u_arg[0]);
+       tprintf("%d, ", (int) tcp->u_arg[0]);
        if (indirect_ipccall(tcp)) {
                tprint_sembuf_array(tcp, tcp->u_arg[3], tcp->u_arg[1]);
        } else {
@@ -82,7 +82,7 @@ SYS_FUNC(semop)
 
 SYS_FUNC(semtimedop)
 {
-       tprintf("%lu, ", tcp->u_arg[0]);
+       tprintf("%d, ", (int) tcp->u_arg[0]);
        if (indirect_ipccall(tcp)) {
                tprint_sembuf_array(tcp, tcp->u_arg[3], tcp->u_arg[1]);
                tprints(", ");
@@ -106,7 +106,7 @@ SYS_FUNC(semget)
                tprintf("%#x", key);
        else
                tprints("IPC_PRIVATE");
-       tprintf(", %lu, ", tcp->u_arg[1]);
+       tprintf(", %d, ", (int) tcp->u_arg[1]);
        if (printflags(resource_flags, tcp->u_arg[2] & ~0777, NULL) != 0)
                tprints("|");
        print_numeric_umode_t(tcp->u_arg[2] & 0777);
@@ -115,7 +115,7 @@ SYS_FUNC(semget)
 
 SYS_FUNC(semctl)
 {
-       tprintf("%lu, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
+       tprintf("%d, %d, ", (int) tcp->u_arg[0], (int) tcp->u_arg[1]);
        PRINTCTL(semctl_flags, tcp->u_arg[2], "SEM_???");
        tprints(", ");
        if (indirect_ipccall(tcp)
index 93c8a27d8a699b3fdc9225374f212ba8a0467f06..f9a053744d4083ff1777fc5df99e75b7b87906c3 100644 (file)
--- a/ipc_shm.c
+++ b/ipc_shm.c
@@ -58,7 +58,7 @@ SYS_FUNC(shmget)
 SYS_FUNC(shmat)
 {
        if (entering(tcp)) {
-               tprintf("%lu, ", tcp->u_arg[0]);
+               tprintf("%d, ", (int) tcp->u_arg[0]);
                if (indirect_ipccall(tcp)) {
                        printaddr(tcp->u_arg[3]);
                        tprints(", ");
index 7ea3672927a1f39ad2c253c7c6f0a4735b1cfeb0..12bb806b1d57be48beb405c32fddf3616e4e5687 100644 (file)
@@ -97,7 +97,7 @@ print_shmid_ds(struct tcb *tcp, const long addr, int cmd)
 SYS_FUNC(shmctl)
 {
        if (entering(tcp)) {
-               tprintf("%lu, ", tcp->u_arg[0]);
+               tprintf("%d, ", (int) tcp->u_arg[0]);
                PRINTCTL(shmctl_flags, tcp->u_arg[1], "SHM_???");
                tprints(", ");
        } else {