Re: [PATCH v2 5/8] syscalls: Add epoll_wait10

Cyril Hrubis <[email protected]>
Newsgroups gmane.linux.ltp
Message-ID <[email protected]>
Hi!
> > +static void check_epoll_event(const char *desc)
> > +{
> > +	struct epoll_event ret_ev;
> > +	char buf[1024];
> > +
> > +	TEST(epoll_wait(efd, &ret_ev, 1, 1000));
> > +	if (TST_RET < 1) {
> > +		tst_res(TFAIL | TTERRNO,
> > +			"epoll_wait() after %s returned %li", desc, TST_RET);
> 
> return; here.

Notice that we need to drain the notification a the bottom, so the best
we can do is goto drain;

> > +	} else if (!(ret_ev.events & (EPOLLPRI | EPOLLERR))) {
> > +		tst_res(TFAIL,
> > +			"after %s: events %x, expected EPOLLPRI or EPOLLERR",
> > +			desc, ret_ev.events);
> > +	} else {
> > +		tst_res(TPASS,
> > +			"epoll_wait() reported event after %s", desc);
> > +	}
> 
> And here I would use TST_EXP_* instead. But feel free to ignore.

However I will shorten this part to TST_EXP_EXPR() so that we have only
one else branch.

-- 
Cyril Hrubis
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.