Blame SOURCES/0123-fcntl-use-print_fields.h-macros.patch

b4ec74
From eba856eb0246ce2a2ba99d68611da1af7814080e Mon Sep 17 00:00:00 2001
b4ec74
From: "Dmitry V. Levin" <ldv@altlinux.org>
b4ec74
Date: Mon, 13 Jul 2020 08:00:00 +0000
b4ec74
Subject: [PATCH 123/138] fcntl: use print_fields.h macros
b4ec74
b4ec74
* fcntl.c: Include "print_fields.h".
b4ec74
(print_struct_flock64, print_f_owner_ex): Use PRINT_FIELD_* macros
b4ec74
from print_fields.h.
b4ec74
---
b4ec74
 fcntl.c | 19 +++++++++----------
b4ec74
 1 file changed, 9 insertions(+), 10 deletions(-)
b4ec74
b4ec74
diff --git a/fcntl.c b/fcntl.c
b4ec74
index 0b4221c..e84549e 100644
b4ec74
--- a/fcntl.c
b4ec74
+++ b/fcntl.c
b4ec74
@@ -11,6 +11,7 @@
b4ec74
 
b4ec74
 #include "defs.h"
b4ec74
 #include "flock.h"
b4ec74
+#include "print_fields.h"
b4ec74
 
b4ec74
 #include "xlat/f_owner_types.h"
b4ec74
 #include "xlat/f_seals.h"
b4ec74
@@ -22,14 +23,12 @@
b4ec74
 static void
b4ec74
 print_struct_flock64(const struct_kernel_flock64 *fl, const int getlk)
b4ec74
 {
b4ec74
-	tprints("{l_type=");
b4ec74
-	printxval(lockfcmds, (unsigned short) fl->l_type, "F_???");
b4ec74
-	tprints(", l_whence=");
b4ec74
-	printxval(whence_codes, (unsigned short) fl->l_whence, "SEEK_???");
b4ec74
-	tprintf(", l_start=%" PRId64 ", l_len=%" PRId64,
b4ec74
-		(int64_t) fl->l_start, (int64_t) fl->l_len);
b4ec74
+	PRINT_FIELD_XVAL("{", *fl, l_type, lockfcmds, "F_???");
b4ec74
+	PRINT_FIELD_XVAL(", ", *fl, l_whence, whence_codes, "SEEK_???");
b4ec74
+	PRINT_FIELD_D(", ", *fl, l_start);
b4ec74
+	PRINT_FIELD_D(", ", *fl, l_len);
b4ec74
 	if (getlk)
b4ec74
-		tprintf(", l_pid=%lu", (unsigned long) fl->l_pid);
b4ec74
+		PRINT_FIELD_D(", ", *fl, l_pid);
b4ec74
 	tprints("}");
b4ec74
 }
b4ec74
 
b4ec74
@@ -59,9 +58,9 @@ print_f_owner_ex(struct tcb *const tcp, const kernel_ulong_t addr)
b4ec74
 	if (umove_or_printaddr(tcp, addr, &owner))
b4ec74
 		return;
b4ec74
 
b4ec74
-	tprints("{type=");
b4ec74
-	printxval(f_owner_types, owner.type, "F_OWNER_???");
b4ec74
-	tprintf(", pid=%d}", owner.pid);
b4ec74
+	PRINT_FIELD_XVAL("{", owner, type, f_owner_types, "F_OWNER_???");
b4ec74
+	PRINT_FIELD_D(", ", owner, pid);
b4ec74
+	tprints("}");
b4ec74
 }
b4ec74
 
b4ec74
 static int
b4ec74
-- 
b4ec74
2.1.4
b4ec74