From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/1] recvmmsg01: Fix compilation
Date: Wed, 23 Sep 2020 11:50:09 +0200 [thread overview]
Message-ID: <20200923095009.GA31351@dell5510> (raw)
In-Reply-To: <20200923094625.30601-1-pvorel@suse.cz>
Hi,
this is wrong, Xao's solution is better:
http://lists.linux.it/pipermail/ltp/2020-September/019060.html
Kind regards,
Petr
> void* cannot be directly used, it must be pointing to the struct.
> recvmmsg01.c:86:9: error: request for member ?type? in something not a
> structure or union
> timeout.type = tv->ts_type;
> Fixes: 135af8ede ("syscalls/{send|recv}mmsg: add a test case for timeout
> and errno test")
> Reported-by: Li Wang <liwang@redhat.com>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> testcases/kernel/syscalls/recvmmsg/recvmmsg01.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
> diff --git a/testcases/kernel/syscalls/recvmmsg/recvmmsg01.c b/testcases/kernel/syscalls/recvmmsg/recvmmsg01.c
> index fe637430b..a16a78f9b 100644
> --- a/testcases/kernel/syscalls/recvmmsg/recvmmsg01.c
> +++ b/testcases/kernel/syscalls/recvmmsg/recvmmsg01.c
> @@ -65,7 +65,8 @@ static void do_test(unsigned int i)
> {
> struct time64_variants *tv = &variants[tst_variant];
> struct test_case *tc = &tcase[i];
> - void *rcv_msgvec, *timeout;
> + struct tst_ts t;
> + void *rcv_msgvec, *timeout = &t;
> tst_res(TINFO, "case %s", tc->desc);
> @@ -83,7 +84,7 @@ static void do_test(unsigned int i)
> memset(rcv1->iov_base, 0, rcv1->iov_len);
> memset(rcv2->iov_base, 0, rcv2->iov_len);
> - timeout.type = tv->ts_type;
> + ((struct tst_ts*)timeout)->type = tv->ts_type;
> tst_ts_set_sec(&ts, tc->tv_sec);
> tst_ts_set_nsec(&ts, tc->tv_nsec);
prev parent reply other threads:[~2020-09-23 9:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-23 9:46 [LTP] [PATCH 1/1] recvmmsg01: Fix compilation Petr Vorel
2020-09-23 9:50 ` Petr Vorel [this message]
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=20200923095009.GA31351@dell5510 \
--to=pvorel@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.