diff mbox series

syscalls/recvmmsg01.c: Fix a compiler error

Message ID 20200923084422.13101-1-yangx.jy@cn.fujitsu.com
State Accepted
Headers show
Series syscalls/recvmmsg01.c: Fix a compiler error | expand

Commit Message

Xiao Yang Sept. 23, 2020, 8:44 a.m. UTC
Use correct ts.type to fix the following compiler error:
--------------------------------------------
recvmmsg01.c:86:9: error: request for member ‘type’ in something not a structure or union
  timeout.type = tv->ts_type;
--------------------------------------------

Fixes: 135af8ededd4 ("syscalls/{send|recv}mmsg: add a test case for timeout and errno test")
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 testcases/kernel/syscalls/recvmmsg/recvmmsg01.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Petr Vorel Sept. 23, 2020, 9:48 a.m. UTC | #1
> Use correct ts.type to fix the following compiler error:
> --------------------------------------------
> recvmmsg01.c:86:9: error: request for member ‘type’ in something not a structure or union
>   timeout.type = tv->ts_type;
> --------------------------------------------

> Fixes: 135af8ededd4 ("syscalls/{send|recv}mmsg: add a test case for timeout and errno test")
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>

Reviewed-by: Petr Vorel <pvorel@suse.cz>

PS: my solution was wrong.


Kind regards,
Petr

> ---
>  testcases/kernel/syscalls/recvmmsg/recvmmsg01.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

> diff --git a/testcases/kernel/syscalls/recvmmsg/recvmmsg01.c b/testcases/kernel/syscalls/recvmmsg/recvmmsg01.c
> index fe637430b..d3f2df6d9 100644
> --- a/testcases/kernel/syscalls/recvmmsg/recvmmsg01.c
> +++ b/testcases/kernel/syscalls/recvmmsg/recvmmsg01.c
> @@ -83,7 +83,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;
> +	ts.type = tv->ts_type;
>  	tst_ts_set_sec(&ts, tc->tv_sec);
>  	tst_ts_set_nsec(&ts, tc->tv_nsec);
Petr Vorel Sept. 23, 2020, 9:51 a.m. UTC | #2
BTW: reported by Li Wang

and also by P.-H. Lin:
https://github.com/linux-test-project/ltp/issues/727

Kind regards,
Petr
Jan Stancek Sept. 23, 2020, 10:02 a.m. UTC | #3
----- Original Message -----
> Use correct ts.type to fix the following compiler error:
> --------------------------------------------
> recvmmsg01.c:86:9: error: request for member ‘type’ in something not a
> structure or union
>   timeout.type = tv->ts_type;
> --------------------------------------------
> 
> Fixes: 135af8ededd4 ("syscalls/{send|recv}mmsg: add a test case for timeout
> and errno test")
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>

Acked-by: Jan Stancek <jstancek@redhat.com>
Xiao Yang Sept. 23, 2020, 1:36 p.m. UTC | #4
On 9/23/20 5:51 PM, Petr Vorel wrote:
> BTW: reported by Li Wang
>
> and also by P.-H. Lin:
> https://github.com/linux-test-project/ltp/issues/727

Hi Petr and Jan,

Sure, I will add Reported-by and the number of issue.

Also thanks for your review. :-)

Thanks,

Xiao Yang

>
> Kind regards,
> Petr
>
Cyril Hrubis Sept. 25, 2020, 11:59 a.m. UTC | #5
Hi!
Actually I've messed up here, I pushed the patch by an accident, the
code is not ready to be included. Let me just revert it.
Xiao Yang Sept. 25, 2020, 3:29 p.m. UTC | #6
On 2020/9/25 19:59, Cyril Hrubis wrote:
> Hi!
> Actually I've messed up here, I pushed the patch by an accident, the
> code is not ready to be included. Let me just revert it.
Hi Cyril,

Thanks for your explanation. :-)
It is fine for me to revert it.

Best Regards,
Xiao Yang
diff mbox series

Patch

diff --git a/testcases/kernel/syscalls/recvmmsg/recvmmsg01.c b/testcases/kernel/syscalls/recvmmsg/recvmmsg01.c
index fe637430b..d3f2df6d9 100644
--- a/testcases/kernel/syscalls/recvmmsg/recvmmsg01.c
+++ b/testcases/kernel/syscalls/recvmmsg/recvmmsg01.c
@@ -83,7 +83,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;
+	ts.type = tv->ts_type;
 	tst_ts_set_sec(&ts, tc->tv_sec);
 	tst_ts_set_nsec(&ts, tc->tv_nsec);