]> Savannah Git Hosting - gnulib.git/commitdiff
sys_select: port better to OpenBSD 6.9
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 2 Oct 2021 21:11:55 +0000 (14:11 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 2 Oct 2021 21:13:14 +0000 (14:13 -0700)
OpenBSD 6.9’s <sys/time.h> includes <sys/select.h> which then
includes <signal.h>, which caused coreutils/lib/nproc.c compiles
to fail with "/usr/include/signal.h:57: warning: 'struct
sigaction' declared inside parameter list".  Fix this.
* lib/sys_select.in.h [__OpenBSD__]: Simply delegate to the system
header if being included from <sys/time.h>.

ChangeLog
lib/sys_select.in.h

index 1c73906258ae4463cdaeaab48e349056b69e2bbe..9bae3c4a3987a2c366bdd86019394e0d861fe201 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2021-10-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+       sys_select: port better to OpenBSD 6.9
+       OpenBSD 6.9’s <sys/time.h> includes <sys/select.h> which then
+       includes <signal.h>, which caused coreutils/lib/nproc.c compiles
+       to fail with "/usr/include/signal.h:57: warning: 'struct
+       sigaction' declared inside parameter list".  Fix this.
+       * lib/sys_select.in.h [__OpenBSD__]: Simply delegate to the system
+       header if being included from <sys/time.h>.
+
 2021-09-22  Bruno Haible  <bruno@clisp.org>
 
        doc: Fix outdated statement about Spanish collation.
index f8ef648d4864e13101c0bc596056cae29596c70f..910bea5d12aa7fd135918ca4a4e48084b0181359 100644 (file)
@@ -21,7 +21,7 @@
 
 /* On OSF/1 and Solaris 2.6, <sys/types.h> and <sys/time.h>
    both include <sys/select.h>.
-   On Cygwin, <sys/time.h> includes <sys/select.h>.
+   On Cygwin and OpenBSD, <sys/time.h> includes <sys/select.h>.
    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             \
@@ -39,6 +39,7 @@
            || (!defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H       \
                && ((defined __osf__ && defined _SYS_TIME_H_             \
                     && defined _OSF_SOURCE)                             \
+                   || (defined __OpenBSD__ && defined _SYS_TIME_H_)     \
                    || (defined __sun && defined _SYS_TIME_H             \
                        && (! (defined _XOPEN_SOURCE                     \
                               || defined _POSIX_C_SOURCE)               \