passfd: Work around bug with CMSG_FIRSTHDR on FreeBSD 6.4.
authorBruno Haible <bruno@clisp.org>
Sun, 13 Mar 2011 22:54:58 +0000 (23:54 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 13 Mar 2011 22:54:58 +0000 (23:54 +0100)
* lib/sys_socket.in.h: Include <stddef.h>.
* m4/afunix.m4 (gl_SOCKET_AFUNIX): Include <stddef.h> before using
CMSG_FIRSTHDR. Remove unused variable.

ChangeLog
lib/sys_socket.in.h
m4/afunix.m4

index b68fa29..873a4c3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2011-03-13  Bruno Haible  <bruno@clisp.org>
 
+       passfd: Work around bug with CMSG_FIRSTHDR on FreeBSD 6.4.
+       * lib/sys_socket.in.h: Include <stddef.h>.
+       * m4/afunix.m4 (gl_SOCKET_AFUNIX): Include <stddef.h> before using
+       CMSG_FIRSTHDR. Remove unused variable.
+
+2011-03-13  Bruno Haible  <bruno@clisp.org>
+
        passfd: Fix compilation error on OpenBSD.
        * lib/passfd.c: Include <sys/uio.h>.
 
index 55f36ef..b60789f 100644 (file)
    <sys/types.h>.  */
 # include <sys/types.h>
 
+/* On FreeBSD 6.4, <sys/socket.h> defines some macros that assume that NULL
+   is defined.  */
+# include <stddef.h>
+
 /* The include_next requires a split double-inclusion guard.  */
 # @INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@
 
index fdedeba..d218537 100644 (file)
@@ -1,4 +1,4 @@
-# afunix.m4 serial 3
+# afunix.m4 serial 4
 dnl Copyright (C) 2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -43,6 +43,7 @@ AC_DEFUN([gl_SOCKET_AFUNIX],
     [AC_COMPILE_IFELSE(
        [AC_LANG_PROGRAM(
           [[#include <sys/types.h>
+            #include <stddef.h>
             #ifdef HAVE_SYS_SOCKET_H
             #include <sys/socket.h>
             #endif
@@ -57,7 +58,6 @@ AC_DEFUN([gl_SOCKET_AFUNIX],
               struct cmsghdr *cmsg;
               int myfds[1] = {0};
               char buf[CMSG_SPACE (sizeof (myfds))];
-              int *fdptr;
 
               msg.msg_control = buf;
               msg.msg_controllen = sizeof buf;