From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 2/2] syscalls/ipc: Make use of get_ipc_timestamp()
Date: Thu, 3 Dec 2020 16:28:04 +0100 [thread overview]
Message-ID: <20201203152804.846-3-chrubis@suse.cz> (raw)
In-Reply-To: <20201203152804.846-1-chrubis@suse.cz>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
testcases/kernel/syscalls/ipc/msgrcv/msgrcv01.c | 4 ++--
testcases/kernel/syscalls/ipc/msgsnd/msgsnd01.c | 4 ++--
testcases/kernel/syscalls/ipc/shmctl/Makefile | 2 +-
testcases/kernel/syscalls/ipc/shmctl/shmctl01.c | 4 ++--
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv01.c b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv01.c
index 5c1e317e9..afe552c4f 100644
--- a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv01.c
+++ b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv01.c
@@ -25,13 +25,13 @@ static void verify_msgrcv(void)
SAFE_MSGSND(queue_id, &snd_buf, MSGSIZE, 0);
- time(&before_rcv);
+ before_rcv = get_ipc_timestamp();
TEST(msgrcv(queue_id, &rcv_buf, MSGSIZE, 1, 0));
if (TST_RET == -1) {
tst_res(TFAIL | TTERRNO, "msgrcv failed");
return;
}
- time(&after_rcv);
+ after_rcv = get_ipc_timestamp();
if (strcmp(rcv_buf.mtext, snd_buf.mtext) == 0)
tst_res(TPASS, "message received(%s) = message sent(%s)",
diff --git a/testcases/kernel/syscalls/ipc/msgsnd/msgsnd01.c b/testcases/kernel/syscalls/ipc/msgsnd/msgsnd01.c
index 5f5da52d2..432b03def 100644
--- a/testcases/kernel/syscalls/ipc/msgsnd/msgsnd01.c
+++ b/testcases/kernel/syscalls/ipc/msgsnd/msgsnd01.c
@@ -29,13 +29,13 @@ static void verify_msgsnd(void)
struct msqid_ds qs_buf;
time_t before_snd, after_snd;
- time(&before_snd);
+ before_snd = get_ipc_timestamp();
TEST(msgsnd(queue_id, &snd_buf, MSGSIZE, 0));
if (TST_RET == -1) {
tst_res(TFAIL | TTERRNO, "msgsnd() failed");
return;
}
- time(&after_snd);
+ after_snd = get_ipc_timestamp();
SAFE_MSGCTL(queue_id, IPC_STAT, &qs_buf);
diff --git a/testcases/kernel/syscalls/ipc/shmctl/Makefile b/testcases/kernel/syscalls/ipc/shmctl/Makefile
index 106b73697..06d72d968 100644
--- a/testcases/kernel/syscalls/ipc/shmctl/Makefile
+++ b/testcases/kernel/syscalls/ipc/shmctl/Makefile
@@ -10,6 +10,6 @@ shmctl05: LDLIBS += -lrt
include $(top_srcdir)/include/mk/testcases.mk
-shmctl02 shmctl04 shmctl06: LTPLDLIBS = -lltpnewipc
+shmctl01 shmctl02 shmctl04 shmctl06: LTPLDLIBS = -lltpnewipc
include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c b/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c
index 3a39a4d74..eb5307d1e 100644
--- a/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c
+++ b/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c
@@ -240,9 +240,9 @@ static int get_shm_idx_from_id(int shm_id)
static void setup(void)
{
- ctime_min = time(NULL);
+ ctime_min = get_ipc_timestamp();
shm_id = SAFE_SHMGET(IPC_PRIVATE, SHM_SIZE, IPC_CREAT | SHM_RW);
- ctime_max = time(NULL);
+ ctime_max = get_ipc_timestamp();
shm_idx = get_shm_idx_from_id(shm_id);
--
2.26.2
next prev parent reply other threads:[~2020-12-03 15:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-03 15:28 [LTP] [PATCH 0/2] Fix timestamp tests in SysV IPC tests Cyril Hrubis
2020-12-03 15:28 ` [LTP] [PATCH 1/2] libnewipc: Add get_ipc_timestamp() Cyril Hrubis
2020-12-04 3:21 ` Li Wang
2020-12-03 15:28 ` Cyril Hrubis [this message]
2020-12-04 9:22 ` [LTP] [PATCH 0/2] Fix timestamp tests in SysV IPC tests Jan Stancek
2020-12-04 10:14 ` Cyril Hrubis
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=20201203152804.846-3-chrubis@suse.cz \
--to=chrubis@suse.cz \
--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