bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* [PATCH] sys_select: port better to OpenBSD 6.9
@ 2021-10-02 21:13 Paul Eggert
  0 siblings, 0 replies; only message in thread
From: Paul Eggert @ 2021-10-02 21:13 UTC (permalink / raw)
  To: bug-gnulib; +Cc: Paul Eggert

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           | 10 ++++++++++
 lib/sys_select.in.h |  3 ++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 1c7390625..9bae3c4a3 100644
--- 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.
diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h
index f8ef648d4..910bea5d1 100644
--- a/lib/sys_select.in.h
+++ b/lib/sys_select.in.h
@@ -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)               \
-- 
2.30.2



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-02 21:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-02 21:13 [PATCH] sys_select: port better to OpenBSD 6.9 Paul Eggert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).