mirror of git://sourceware.org/git/glibc.git
Fix invalid use of NULL in epoll_pwait2(2) test
epoll_pwait2(2)'s second argument should be nonnull. We're going to add __nonnull to the prototype, so let's fix the test accordingly. We can use a dummy variable to avoid passing NULL. Reported-by: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
parent
884012db20
commit
cc5372806a
|
|
@ -180,6 +180,8 @@ epoll_pwait2_check (int epfd, struct epoll_event *ev, int maxev, int tmo,
|
||||||
static int
|
static int
|
||||||
do_test (void)
|
do_test (void)
|
||||||
{
|
{
|
||||||
|
struct epoll_event ev;
|
||||||
|
|
||||||
{
|
{
|
||||||
struct sigaction sa;
|
struct sigaction sa;
|
||||||
sa.sa_handler = handler;
|
sa.sa_handler = handler;
|
||||||
|
|
@ -191,7 +193,7 @@ do_test (void)
|
||||||
xsigaction (SIGCHLD, &sa, NULL);
|
xsigaction (SIGCHLD, &sa, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
int r = epoll_pwait2 (-1, NULL, 0, NULL, NULL);
|
int r = epoll_pwait2 (-1, &ev, 0, NULL, NULL);
|
||||||
TEST_COMPARE (r, -1);
|
TEST_COMPARE (r, -1);
|
||||||
bool pwait2_supported = errno != ENOSYS;
|
bool pwait2_supported = errno != ENOSYS;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue