]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Regtest: foix warning from drd test pth_mutex_signal.c
authorPaul Floyd <pjfloyd@wanadoo.fr>
Fri, 3 Feb 2023 12:48:22 +0000 (13:48 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Fri, 3 Feb 2023 12:48:22 +0000 (13:48 +0100)
GCC on RHEL 7.6 ARM complains about the empty init list.

I also noticed that we are using the SA_NOTIFY form of sigaction
(with that union member and handler prototype) but not setting the
SA_NOTIFY flag. Seems harmless in this case as we don't use
the siginfo or context.

drd/tests/pth_mutex_signal.c

index 38fafdba8ad8297498c3e280b1443fe1b17e1344..916afdfe599f3cbd24f4cd77e7d6d9e7ef95e4d4 100644 (file)
@@ -42,12 +42,12 @@ int main ()
   pthread_mutexattr_t mutex_attr;
   pthread_attr_t thread_attr_contender;
   pthread_t contender;
-  struct sigaction signalAction = { };
+  struct sigaction signalAction;
 
   // install signal handler
   signalAction.sa_sigaction = nullHandler;
   sigfillset(&signalAction.sa_mask);
-  signalAction.sa_flags = 0;
+  signalAction.sa_flags = SA_SIGINFO;
   sigaction(SIGINT, &signalAction, NULL);
 
   // initialize the mutex