From: Khem Raj <raj.khem@gmail.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] ltp-pan: Use long long int to print time_t
Date: Sun, 20 Dec 2020 22:14:15 -0800 [thread overview]
Message-ID: <20201221061415.2540216-1-raj.khem@gmail.com> (raw)
Some newer 32bit architectures ( e.g. riscv32 ) uses 64bit time_t so
using %ld is not sufficient to print time_t, this also fixes a crash in
ltp-pan on riscv32
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
pan/ltp-pan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pan/ltp-pan.c b/pan/ltp-pan.c
index 8b9fbe5594..54b7cb8f26 100644
--- a/pan/ltp-pan.c
+++ b/pan/ltp-pan.c
@@ -1389,8 +1389,8 @@ static void write_test_start(struct tag_pgrp *running, int no_kmsg)
if (!strcmp(reporttype, "rts")) {
printf
- ("%s\ntag=%s stime=%ld\ncmdline=\"%s\"\ncontacts=\"%s\"\nanalysis=%s\n%s\n",
- "<<<test_start>>>", running->cmd->name, running->mystime,
+ ("%s\ntag=%s stime=%lld\ncmdline=\"%s\"\ncontacts=\"%s\"\nanalysis=%s\n%s\n",
+ "<<<test_start>>>", running->cmd->name, (long long)running->mystime,
running->cmd->cmdline, "", "exit", "<<<test_output>>>");
}
fflush(stdout);
--
2.29.2
next reply other threads:[~2020-12-21 6:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-21 6:14 Khem Raj [this message]
2020-12-21 21:25 ` [LTP] [PATCH] ltp-pan: Use long long int to print time_t Petr Vorel
2020-12-22 17:05 ` Petr Vorel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201221061415.2540216-1-raj.khem@gmail.com \
--to=raj.khem@gmail.com \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox