From e2fb7afb4669e3b3f3c7633e6ac9534f0df15441 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 5 Aug 2014 13:19:57 -0700 Subject: [PATCH] sys_select: fix FD_ZERO problem on Solaris 10 * lib/sys_select.in.h: Fix Solaris 10 bug where "#include " followed by "#include " caused FD_ZERO to expand to an expression that invoked memset without necessarily including . The problem was that the first include defined _SYS_TIME_H, causing the second include to short-circuit. Fix a similar problem with followed by . Also, fix what appears to be a cut-and-paste typo, by replacing _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H with _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H. --- ChangeLog | 11 +++++++++++ lib/sys_select.in.h | 15 ++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 43b8fe3ef3..8e74a548d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2014-08-05 Paul Eggert + sys_select: fix FD_ZERO problem on Solaris 10 + * lib/sys_select.in.h: Fix Solaris 10 bug where "#include + " followed by "#include " caused FD_ZERO + to expand to an expression that invoked memset without necessarily + including . The problem was that the first include + defined _SYS_TIME_H, causing the second include to short-circuit. + Fix a similar problem with followed by . + Also, fix what appears to be a cut-and-paste typo, by replacing + _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H with + _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H. + accept: document Solaris 10 type glitch * doc/posix-functions/accept.texi (accept): Mention that Solaris 10 'accept' takes void * last arg, not socklen_t *. diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h index 6ac7b084f3..1186f68212 100644 --- a/lib/sys_select.in.h +++ b/lib/sys_select.in.h @@ -24,8 +24,8 @@ On Cygwin, includes . Simply delegate to the system's header in this case. */ #if (@HAVE_SYS_SELECT_H@ \ + && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H \ && ((defined __osf__ && defined _SYS_TYPES_H_ \ - && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H \ && defined _OSF_SOURCE) \ || (defined __sun && defined _SYS_TYPES_H \ && (! (defined _XOPEN_SOURCE || defined _POSIX_C_SOURCE) \ @@ -36,12 +36,13 @@ #elif (@HAVE_SYS_SELECT_H@ \ && (defined _CYGWIN_SYS_TIME_H \ - || (defined __osf__ && defined _SYS_TIME_H_ \ - && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H \ - && defined _OSF_SOURCE) \ - || (defined __sun && defined _SYS_TIME_H \ - && (! (defined _XOPEN_SOURCE || defined _POSIX_C_SOURCE) \ - || defined __EXTENSIONS__)))) + || (!defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H \ + && ((defined __osf__ && defined _SYS_TIME_H_ \ + && defined _OSF_SOURCE) \ + || (defined __sun && defined _SYS_TIME_H \ + && (! (defined _XOPEN_SOURCE \ + || defined _POSIX_C_SOURCE) \ + || defined __EXTENSIONS__)))))) # define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H # @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@ -- 2.39.5