summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2020-09-19 08:00:00 +0000
committerDmitry V. Levin <ldv@altlinux.org>2020-09-19 08:00:00 +0000
commita26a6d4eadcb72bb9b598401422e1fbd20187914 (patch)
treea0a907fbae0ad5c92f3cc460c27c6bdabd4f17e6
parentc2e4f189f457c37e6c2383aadd09674e4ac1a1a2 (diff)
downloadstrace-a26a6d4eadcb72bb9b598401422e1fbd20187914.tar.gz
shmctl: consistently use macros from print_fields.h
* ipc_shmctl.c (key): Define. (print_shmid_ds): Use PRINT_FIELD_U instead of tprintf.
-rw-r--r--ipc_shmctl.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/ipc_shmctl.c b/ipc_shmctl.c
index 1f99f02a0..4ce9995bc 100644
--- a/ipc_shmctl.c
+++ b/ipc_shmctl.c
@@ -25,6 +25,8 @@ typedef struct NAME_OF_STRUCT_SHMID_DS shmid_ds_t;
#include "print_fields.h"
#include "xlat/shmctl_flags.h"
+#define key NAME_OF_STRUCT_IPC_PERM_KEY
+
static void
print_shmid_ds(struct tcb *const tcp, const kernel_ulong_t addr, int cmd)
{
@@ -47,18 +49,17 @@ print_shmid_ds(struct tcb *const tcp, const kernel_ulong_t addr, int cmd)
break;
}
- tprintf(", key=%u",
- (unsigned) shmid_ds.shm_perm.NAME_OF_STRUCT_IPC_PERM_KEY);
+ PRINT_FIELD_U(", ", shmid_ds.shm_perm, key);
PRINT_FIELD_UID(", ", shmid_ds.shm_perm, cuid);
PRINT_FIELD_UID(", ", shmid_ds.shm_perm, cgid);
tprints("}");
- tprintf(", shm_segsz=%u", (unsigned) shmid_ds.shm_segsz);
+ PRINT_FIELD_U(", ", shmid_ds, shm_segsz);
PRINT_FIELD_TGID(", ", shmid_ds, shm_cpid, tcp);
PRINT_FIELD_TGID(", ", shmid_ds, shm_lpid, tcp);
- tprintf(", shm_nattch=%u", (unsigned) shmid_ds.shm_nattch);
- tprintf(", shm_atime=%u", (unsigned) shmid_ds.shm_atime);
- tprintf(", shm_dtime=%u", (unsigned) shmid_ds.shm_dtime);
- tprintf(", shm_ctime=%u", (unsigned) shmid_ds.shm_ctime);
+ PRINT_FIELD_U(", ", shmid_ds, shm_nattch);
+ PRINT_FIELD_U(", ", shmid_ds, shm_atime);
+ PRINT_FIELD_U(", ", shmid_ds, shm_dtime);
+ PRINT_FIELD_U(", ", shmid_ds, shm_ctime);
tprints("}");
break;