From: Simon Marchi <simon.marchi@efficios.com>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: [pushed] gdb: remove O_NOCTTY fallback definitions
Date: Thu, 22 Oct 2026 12:57:37 -0400 [thread overview]
Message-ID: <20261022165739.232325-1-simon.marchi@efficios.com> (raw)
top.c and inflow.c define O_NOCTTY to 0 if it is not defined. This is
unnecessary, since gnulib's fcntl.h already provides the same fallback:
‘O_DSYNC’, ‘O_NOCTTY’, ‘O_NOFOLLOW’, ‘O_RSYNC’, ‘O_SYNC’, and
‘O_TTY_INIT’ are not defined on some platforms. When not otherwise
defined, Gnulib defines these macros to 0, which is generally safe.
Other files use O_NOCTTY without defining the fallback, showing that the
gnulib fallback works.
Add fcntl-h to the list of imported gnulib modules, since we now
explicitly rely on it. Nothing changes in the import, since that module
was already imported as a dependency.
Change-Id: Ia4e34d5a2521a1e92f2d284b527e996e75f66d28
---
gdb/inflow.c | 4 ----
gdb/top.c | 4 ----
gnulib/import/Makefile.am | 1 +
gnulib/import/Makefile.in | 1 +
gnulib/import/m4/gnulib-cache.m4 | 2 ++
gnulib/update-gnulib.sh | 1 +
6 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/gdb/inflow.c b/gdb/inflow.c
index c40ad2cf5294..9ad8e628363d 100644
--- a/gdb/inflow.c
+++ b/gdb/inflow.c
@@ -43,10 +43,6 @@
#include <sys/cygwin.h>
#endif
-#ifndef O_NOCTTY
-#define O_NOCTTY 0
-#endif
-
static void pass_signal (int);
static int gdb_has_a_terminal (void);
diff --git a/gdb/top.c b/gdb/top.c
index 308b5552fd5e..18d4bfcd4fd3 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -80,10 +80,6 @@
# include "tui/tui-io.h"
#endif
-#ifndef O_NOCTTY
-# define O_NOCTTY 0
-#endif
-
extern void initialize_all_files (void);
/* Default command line prompt. This is overridden in some configs. */
diff --git a/gnulib/import/Makefile.am b/gnulib/import/Makefile.am
index 1548615f131a..951965f54428 100644
--- a/gnulib/import/Makefile.am
+++ b/gnulib/import/Makefile.am
@@ -44,6 +44,7 @@
# dirent \
# dirfd \
# errno \
+# fcntl-h \
# ffs \
# fnmatch-gnu \
# frexpl \
diff --git a/gnulib/import/Makefile.in b/gnulib/import/Makefile.in
index 2e567c09d389..d8bb5ff429be 100644
--- a/gnulib/import/Makefile.in
+++ b/gnulib/import/Makefile.in
@@ -58,6 +58,7 @@
# dirent \
# dirfd \
# errno \
+# fcntl-h \
# ffs \
# fnmatch-gnu \
# frexpl \
diff --git a/gnulib/import/m4/gnulib-cache.m4 b/gnulib/import/m4/gnulib-cache.m4
index 0cf177add8e5..a0e6cf2bd4a0 100644
--- a/gnulib/import/m4/gnulib-cache.m4
+++ b/gnulib/import/m4/gnulib-cache.m4
@@ -49,6 +49,7 @@
# dirent \
# dirfd \
# errno \
+# fcntl-h \
# ffs \
# fnmatch-gnu \
# frexpl \
@@ -105,6 +106,7 @@ gl_MODULES([
dirent
dirfd
errno
+ fcntl-h
ffs
fnmatch-gnu
frexpl
diff --git a/gnulib/update-gnulib.sh b/gnulib/update-gnulib.sh
index 0e3964f1bbe9..f38b31f31faf 100755
--- a/gnulib/update-gnulib.sh
+++ b/gnulib/update-gnulib.sh
@@ -41,6 +41,7 @@ IMPORTED_GNULIB_MODULES="\
dirent \
dirfd \
errno \
+ fcntl-h \
ffs \
fnmatch-gnu \
frexpl \
base-commit: 3793336385dec373c5dc626bf9088041365d3701
--
2.56.0
next reply other threads:[~2026-10-22 16:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-22 16:57 Simon Marchi [this message]
2026-10-22 18:36 ` Tom Tromey
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261022165739.232325-1-simon.marchi@efficios.com \
--to=simon.marchi@efficios.com \
--cc=gdb-patches@sourceware.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