about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2014-12-21 02:39:19 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2014-12-21 02:39:19 +0000
commitc20608b2b2cc91367ecc2d8fe5e4cc9d4b709285 (patch)
tree408fd3058dc014f2f233c743965ace04cd9ebdf4 /src
parent31009f586a04251df0fb5853017ecfcaf70b307f (diff)
downloadskalibs-c20608b2b2cc91367ecc2d8fe5e4cc9d4b709285.tar.gz
skalibs-c20608b2b2cc91367ecc2d8fe5e4cc9d4b709285.tar.xz
skalibs-c20608b2b2cc91367ecc2d8fe5e4cc9d4b709285.zip
next generation of the FreeBSD fix...
Diffstat (limited to 'src')
-rw-r--r--src/sysdeps/tryaccept4.c8
-rw-r--r--src/sysdeps/tryancilautoclose.c7
-rw-r--r--src/sysdeps/trynbwaitall.c5
3 files changed, 5 insertions, 15 deletions
diff --git a/src/sysdeps/tryaccept4.c b/src/sysdeps/tryaccept4.c
index e27eb1a..d6c462a 100644
--- a/src/sysdeps/tryaccept4.c
+++ b/src/sysdeps/tryaccept4.c
@@ -4,19 +4,15 @@
 #undef _XOPEN_SOURCE
 
 #ifndef _XPG4_2
-# define _XPG4_2
+#define _XPG4_2
 #endif
 
 #ifndef _GNU_SOURCE
-# define _GNU_SOURCE
+#define _GNU_SOURCE
 #endif
 
 #include <sys/types.h>
 
-#if defined(__FreeBSD__)
-# include <sys/param.h>
-#endif
-
 #include <sys/socket.h>
 #include <sys/stat.h>
 #include <fcntl.h>
diff --git a/src/sysdeps/tryancilautoclose.c b/src/sysdeps/tryancilautoclose.c
index d0a2833..1db7a7a 100644
--- a/src/sysdeps/tryancilautoclose.c
+++ b/src/sysdeps/tryancilautoclose.c
@@ -8,7 +8,7 @@
 #endif
 
 #ifndef _XPG4_2
-# define _XPG4_2
+#define _XPG4_2
 #endif
 
 #include <sys/types.h>
@@ -17,9 +17,6 @@
 #include <errno.h>
 #include <sys/socket.h>
 #include <sys/uio.h>
-#if defined(__FreeBSD__)
-# include <sys/param.h>
-#endif
 
 static int ancil_send_fd (int sock, int fd)
 {
@@ -37,7 +34,7 @@ static int ancil_send_fd (int sock, int fd)
     .msg_controllen = sizeof(ancilbuf)
   } ;
   struct cmsghdr *cmsg = CMSG_FIRSTHDR(&msghdr) ;
-  cmsg->cmsg_len = msghdr.msg_controllen ;
+  cmsg->cmsg_len = CMSG_LEN(sizeof(int)) ;
   cmsg->cmsg_level = SOL_SOCKET ;
   cmsg->cmsg_type = SCM_RIGHTS ;
   *((int *)CMSG_DATA(cmsg)) = fd ;
diff --git a/src/sysdeps/trynbwaitall.c b/src/sysdeps/trynbwaitall.c
index ae79f1c..0277ead 100644
--- a/src/sysdeps/trynbwaitall.c
+++ b/src/sysdeps/trynbwaitall.c
@@ -4,7 +4,7 @@
 #undef _XOPEN_SOURCE
 
 #ifndef _XPG4_2
-# define _XPG4_2
+#define _XPG4_2
 #endif
 
 #ifndef _BSD_SOURCE
@@ -19,9 +19,6 @@
 #include <sys/socket.h>
 #include <sys/select.h>
 #include <sys/uio.h>
-#if defined(__FreeBSD__)
-#include <sys/param.h>
-#endif
 
 #ifndef MSG_NOSIGNAL
 #define MSG_NOSIGNAL 0