From 64d04198d3c64756ae8a51646b6eac3dff419cb6 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Fri, 17 Jul 2020 08:00:00 +0000 Subject: [PATCH 126/138] Use PRINT_FIELD_UID instead of printuid where appropriate * ipc_msgctl.c: Include "print_fields.h". (print_msqid_ds): Use PRINT_FIELD_UID instead of printuid. * ipc_shmctl.c: Include "print_fields.h". (print_shmid_ds): Use PRINT_FIELD_UID instead of printuid. * statx.c (SYS_FUNC(statx)): Use PRINT_FIELD_UID instead of printuid. --- ipc_msgctl.c | 10 +++++----- ipc_shmctl.c | 10 +++++----- statx.c | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ipc_msgctl.c b/ipc_msgctl.c index 92eda11..920ed72 100644 --- a/ipc_msgctl.c +++ b/ipc_msgctl.c @@ -22,6 +22,7 @@ typedef struct NAME_OF_STRUCT_MSQID_DS msqid_ds_t; #include MPERS_DEFS +#include "print_fields.h" #include "xlat/msgctl_flags.h" static void @@ -37,9 +38,8 @@ print_msqid_ds(struct tcb *const tcp, const kernel_ulong_t addr, int cmd) if (umove_or_printaddr(tcp, addr, &msqid_ds)) return; - tprints("{msg_perm={"); - printuid("uid=", msqid_ds.msg_perm.uid); - printuid(", gid=", msqid_ds.msg_perm.gid); + PRINT_FIELD_UID("{msg_perm={", msqid_ds.msg_perm, uid); + PRINT_FIELD_UID(", ", msqid_ds.msg_perm, gid); tprints(", mode="); print_numeric_umode_t(msqid_ds.msg_perm.mode); @@ -50,8 +50,8 @@ print_msqid_ds(struct tcb *const tcp, const kernel_ulong_t addr, int cmd) tprintf(", key=%u", (unsigned) msqid_ds.msg_perm.NAME_OF_STRUCT_IPC_PERM_KEY); - printuid(", cuid=", msqid_ds.msg_perm.cuid); - printuid(", cgid=", msqid_ds.msg_perm.cgid); + PRINT_FIELD_UID(", ", msqid_ds.msg_perm, cuid); + PRINT_FIELD_UID(", ", msqid_ds.msg_perm, cgid); tprints("}"); tprintf(", msg_stime=%u", (unsigned) msqid_ds.msg_stime); tprintf(", msg_rtime=%u", (unsigned) msqid_ds.msg_rtime); diff --git a/ipc_shmctl.c b/ipc_shmctl.c index 0fb584e..83e36f3 100644 --- a/ipc_shmctl.c +++ b/ipc_shmctl.c @@ -22,6 +22,7 @@ typedef struct NAME_OF_STRUCT_SHMID_DS shmid_ds_t; #include MPERS_DEFS +#include "print_fields.h" #include "xlat/shmctl_flags.h" static void @@ -37,9 +38,8 @@ print_shmid_ds(struct tcb *const tcp, const kernel_ulong_t addr, int cmd) if (umove_or_printaddr(tcp, addr, &shmid_ds)) return; - tprints("{shm_perm={"); - printuid("uid=", shmid_ds.shm_perm.uid); - printuid(", gid=", shmid_ds.shm_perm.gid); + PRINT_FIELD_UID("{shm_perm={", shmid_ds.shm_perm, uid); + PRINT_FIELD_UID(", ", shmid_ds.shm_perm, gid); tprints(", mode="); print_numeric_umode_t(shmid_ds.shm_perm.mode); @@ -50,8 +50,8 @@ print_shmid_ds(struct tcb *const tcp, const kernel_ulong_t addr, int cmd) tprintf(", key=%u", (unsigned) shmid_ds.shm_perm.NAME_OF_STRUCT_IPC_PERM_KEY); - printuid(", cuid=", shmid_ds.shm_perm.cuid); - printuid(", cgid=", shmid_ds.shm_perm.cgid); + 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); tprintf(", shm_cpid=%u", (unsigned) shmid_ds.shm_cpid); diff --git a/statx.c b/statx.c index 54b6d7c..7b00b8e 100644 --- a/statx.c +++ b/statx.c @@ -60,8 +60,8 @@ SYS_FUNC(statx) if (!abbrev(tcp)) { PRINT_FIELD_U(", ", stx, stx_nlink); - printuid(", stx_uid=", stx.stx_uid); - printuid(", stx_gid=", stx.stx_gid); + PRINT_FIELD_UID(", ", stx, stx_uid); + PRINT_FIELD_UID(", ", stx, stx_gid); } tprints(", stx_mode="); -- 2.1.4