From 42460ca710c36a4994a14eda6b176397cdc40139 Mon Sep 17 00:00:00 2001 From: Eugene Syromyatnikov Date: Wed, 26 Sep 2018 18:56:15 +0200 Subject: [PATCH] syslog: print syslog command with verbose style, as it is not in UAPI * syslog.c (SYS_FUNC(syslog)): Print syslog_action_type using XLAT_STYLE_VERBOSE. * tests/syslog.c: Update expected output. --- syslog.c | 3 ++- tests/syslog.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/syslog.c b/syslog.c index 34d56199..3d1d3d26 100644 --- a/syslog.c +++ b/syslog.c @@ -16,7 +16,8 @@ SYS_FUNC(syslog) if (entering(tcp)) { /* type */ - printxval(syslog_action_type, type, "SYSLOG_ACTION_???"); + printxval_ex(syslog_action_type, type, "SYSLOG_ACTION_???", + XLAT_STYLE_VERBOSE | XLAT_STYLE_FMT_D); tprints(", "); } diff --git a/tests/syslog.c b/tests/syslog.c index 8cb1f47f..028514b3 100644 --- a/tests/syslog.c +++ b/tests/syslog.c @@ -22,11 +22,11 @@ main(void) const long addr = (long) 0xfacefeeddeadbeefULL; int rc = syscall(__NR_syslog, SYSLOG_ACTION_READ, addr, -1); - printf("syslog(SYSLOG_ACTION_READ, %#lx, -1) = %s\n", + printf("syslog(2 /* SYSLOG_ACTION_READ */, %#lx, -1) = %s\n", addr, sprintrc(rc)); rc = syscall(__NR_syslog, SYSLOG_ACTION_SIZE_BUFFER, NULL, 10); - printf("syslog(SYSLOG_ACTION_SIZE_BUFFER, NULL, 10) = %s\n", + printf("syslog(10 /* SYSLOG_ACTION_SIZE_BUFFER */, NULL, 10) = %s\n", sprintrc(rc)); puts("+++ exited with 0 +++"); -- 2.40.0