]> granicus.if.org Git - strace/commitdiff
ipc: fix printing of nsops argument of semop and semtimedop syscalls
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 9 Sep 2016 19:13:54 +0000 (19:13 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 9 Sep 2016 22:18:11 +0000 (22:18 +0000)
According to POSIX, nsops argument of semop syscall has type size_t,
but the kernel treats nsops argument of semop and semtimedop syscalls
as unsigned int.

* ipc_sem.c (tprint_sembuf_array): Change type of "count" argument
from unsigned long to unsigned int, print it using %u format.

ipc_sem.c

index 4725a170176a0a0191388eb1461627f0488aeba3..db79746988b0a77f089114498e7aa158f690f6fc 100644 (file)
--- a/ipc_sem.c
+++ b/ipc_sem.c
@@ -57,7 +57,7 @@ print_sembuf(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
 #endif
 
 static void
-tprint_sembuf_array(struct tcb *tcp, const long addr, const unsigned long count)
+tprint_sembuf_array(struct tcb *tcp, const long addr, const unsigned int count)
 {
 #if defined HAVE_SYS_SEM_H || defined HAVE_LINUX_SEM_H
        struct sembuf sb;
@@ -66,7 +66,7 @@ tprint_sembuf_array(struct tcb *tcp, const long addr, const unsigned long count)
 #else
        printaddr(addr);
 #endif
-       tprintf(", %lu", count);
+       tprintf(", %u", count);
 }
 
 SYS_FUNC(semop)