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 b68fa29784a7320de17b59968fc02be3b941bbf8..873a4c369c9470f7857158e7b926f1a8923d7e7b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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.
index 55f36ef12086f34c9ce2537a75b36e126efa3617..b60789f2a1dd0f7bb6cc321755712a4cafde7033 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 fdedeba67398adedd7c5f00659510084edfed7a6..d218537cc1fb3fc64f25ebaa9829da232ee7fcef 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;