From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 2/2] syscalls/uname02: Convert to new API and cleanup
Date: Thu, 12 Nov 2020 11:17:26 +0100 [thread overview]
Message-ID: <20201112101726.GA11365@yuki.lan> (raw)
In-Reply-To: <20201112012613.1426897-1-yangx.jy@cn.fujitsu.com>
Hi!
Pushed with minor changes, thanks.
I've added a check for the invalid return value and got rid of the cast
since void* does not need it.
diff --git a/testcases/kernel/syscalls/uname/uname02.c b/testcases/kernel/syscalls/uname/uname02.c
index 09c26939e..1903dae24 100644
--- a/testcases/kernel/syscalls/uname/uname02.c
+++ b/testcases/kernel/syscalls/uname/uname02.c
@@ -16,12 +16,17 @@ static void *bad_addr;
static void verify_uname(void)
{
- TEST(uname((struct utsname *)bad_addr));
+ TEST(uname(bad_addr));
if (TST_RET == 0) {
tst_res(TFAIL, "uname() succeed when failure expected");
return;
}
+ if (TST_RET != -1) {
+ tst_res(TFAIL, "Invalid uname() return value %ld", TST_RET);
+ return;
+ }
+
if (TST_ERR == EFAULT)
tst_res(TPASS, "uname() got EFAULT as expected");
else
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2020-11-12 10:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-06 6:50 [LTP] [PATCH 1/2] syscalls/uname{01, 03}: Convert to new API and cleanup Xiao Yang
2020-11-06 6:50 ` [LTP] [PATCH 2/2] syscalls/uname02: " Xiao Yang
2020-11-11 14:57 ` Cyril Hrubis
2020-11-12 1:26 ` [LTP] [PATCH v2 " Xiao Yang
2020-11-12 10:17 ` Cyril Hrubis [this message]
2020-11-12 1:44 ` [LTP] [PATCH " Xiao Yang
2020-11-11 14:54 ` [LTP] [PATCH 1/2] syscalls/uname{01, 03}: " 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=20201112101726.GA11365@yuki.lan \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.