[PATCH v2 1/9] Change type of the format specifier from "%lu" to "%d" for IPC ID

Eugene Syromyatnikov evgsyr at gmail.com
Thu Sep 8 14:05:48 UTC 2016


* ipc_msgctl.c (SYS_FUNC(msgctl)): Convert format specifier of the first
  argument from "%lu" to "%d", cast argument to int.
* ipc_sem.c (SYS_FUNC(semop)): Likewise.
  (SYS_FUNC(semtimedop)): Likewise.
  (SYS_FUNC(semget)): Likewise.
* ipc_shm.c (SYS_FUNC(shmat)): Likewise.
* ipc_shmctl.c (SYS_FUNC(shmctl)): Likewise.
---
 ipc_msgctl.c |    2 +-
 ipc_sem.c    |    8 ++++----
 ipc_shm.c    |    2 +-
 ipc_shmctl.c |    2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/ipc_msgctl.c b/ipc_msgctl.c
index 9be35ce..a7352cb 100644
--- a/ipc_msgctl.c
+++ b/ipc_msgctl.c
@@ -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 {
diff --git a/ipc_sem.c b/ipc_sem.c
index e6172ee..81a2ff7 100644
--- 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(", ");
@@ -105,7 +105,7 @@ SYS_FUNC(semget)
 		tprintf("%#lx", tcp->u_arg[0]);
 	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);
@@ -114,7 +114,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)
diff --git a/ipc_shm.c b/ipc_shm.c
index e8a8206..072c5e1 100644
--- a/ipc_shm.c
+++ b/ipc_shm.c
@@ -57,7 +57,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(", ");
diff --git a/ipc_shmctl.c b/ipc_shmctl.c
index 7ea3672..12bb806 100644
--- a/ipc_shmctl.c
+++ b/ipc_shmctl.c
@@ -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 {
-- 
1.7.10.4





More information about the Strace-devel mailing list