]> sourceware.org Git - glibc.git/commitdiff
Fix invalid use of NULL in epoll_pwait2(2) test
authorAlejandro Colomar <alx.manpages@gmail.com>
Wed, 31 May 2023 20:44:22 +0000 (22:44 +0200)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 1 Jun 2023 17:50:35 +0000 (14:50 -0300)
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>
sysdeps/unix/sysv/linux/tst-epoll.c

index 66f091c202c5df7492732ba7bf2c438453428902..abda45c4275a1dbe7b35e2d04eeba2fb545f6e0d 100644 (file)
@@ -180,6 +180,8 @@ epoll_pwait2_check (int epfd, struct epoll_event *ev, int maxev, int tmo,
 static int
 do_test (void)
 {
+  struct epoll_event ev;
+
   {
     struct sigaction sa;
     sa.sa_handler = handler;
@@ -191,7 +193,7 @@ do_test (void)
     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);
   bool pwait2_supported = errno != ENOSYS;
 
This page took 0.048354 seconds and 5 git commands to generate.