bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: bug-gnulib@gnu.org
Cc: Paul Eggert <eggert@cs.ucla.edu>
Subject: [PATCH] sys_select: port better to OpenBSD 6.9
Date: Sat,  2 Oct 2021 14:13:30 -0700	[thread overview]
Message-ID: <20211002211330.196639-1-eggert@cs.ucla.edu> (raw)

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



                 reply	other threads:[~2021-10-02 21:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211002211330.196639-1-eggert@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=bug-gnulib@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).