]> sourceware.org Git - valgrind.git/commitdiff
musl regtest : fix warnings and badly initialized struct msghdr
authorPaul Floyd <pjfloyd@wanadoo.fr>
Tue, 21 Feb 2023 22:05:22 +0000 (23:05 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Tue, 21 Feb 2023 22:05:22 +0000 (23:05 +0100)
memcheck/tests/badpoll.c
memcheck/tests/linux/syscalls-2007.c
memcheck/tests/linux/timerfd-syscall.c
none/tests/fdleak_cmsg.c

index 61b8d31bb1468b397392cc933165350e75b74ecb..beae44aa3179db190fd36040ce2218d1f04c6c72 100644 (file)
@@ -1,6 +1,6 @@
 #include <assert.h>
 #include <stdlib.h>
-#include <sys/poll.h>
+#include <poll.h>
 
 // At one point, poll()'s checking was not done accurately.  This test
 // exposes this -- previously Memcheck only found one error, now if finds
index 54946237eb1567084aa678dd802bcb1558843c2c..b91df82a5e75932aec4a4fc94b24b8cd595ab907 100644 (file)
@@ -20,9 +20,7 @@
 #if defined(HAVE_SYS_EVENTFD_H)
 #include <sys/eventfd.h>
 #endif
-#if defined(HAVE_SYS_POLL_H)
-#include <sys/poll.h>
-#endif
+#include <poll.h>
 #if defined(HAVE_SYS_SIGNALFD_H)
 #include <sys/signalfd.h>
 #endif
index 4af622cc4814a7ad3314a009eb667437e29f6485..61d75b55456bf7f34afd2ee0dd0a11447956e483 100644 (file)
@@ -35,9 +35,7 @@
 #include <string.h>
 #include <time.h>
 #include <unistd.h>
-#if defined(HAVE_SYS_SIGNAL_H)
-#include <sys/signal.h>
-#endif
+#include <signal.h>
 #if defined(HAVE_SYS_SYSCALL_H)
 #include <sys/syscall.h>
 #endif
index 7927045f5b53825ba3d2ca5a87dc7c9f16ed4f25..d4300bcf2da1a2e9c11c17322d7c2d064554a998 100644 (file)
@@ -91,8 +91,18 @@ void client (void)
       struct cmsghdr cm;
       char control[CMSG_SPACE(sizeof(int) * 2)];
    } control_un;
-   struct msghdr msg = { NULL, 0, iov, 1, control_un.control,
-                         sizeof(control_un), 0 };
+   struct msghdr msg;
+   /* this was using brace initialization
+    * but that doesn't work on MSL because of padding fields
+    * C99 designated initializers would be nicer
+    * but I'll just do it the simple way */
+   msg.msg_name = NULL;
+   msg.msg_namelen = 0;
+   msg.msg_iov = iov;
+   msg.msg_iovlen = 1;
+   msg.msg_control = control_un.control;
+   msg.msg_controllen = sizeof(control_un);
+   msg.msg_flags = 0;
    struct cmsghdr *cmsg = &control_un.cm;
    char buf[1024];
 
This page took 0.036279 seconds and 5 git commands to generate.