From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id H/RpOaBA2mqKFgwAWB0awg (envelope-from ) for ; Thu, 22 Oct 2026 12:58:08 -0400 Received: by simark.ca (Postfix, from userid 112) id B9F85378002; Thu, 22 Oct 2026 12:58:08 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id A87981E007 for ; Thu, 22 Oct 2026 12:58:07 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 48A4E4BA23D6 for ; Thu, 22 Oct 2026 16:58:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 48A4E4BA23D6 Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 0495A4BA2E06 for ; Thu, 22 Oct 2026 16:57:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0495A4BA2E06 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0495A4BA2E06 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1792688263; cv=none; b=ZPYDHqq2z/IQM0xf62RySNG7Sizoum4RkDxziVPdIxq6LRL6W1tdBLzwDKt87mUKA3znAG7x5cvlUywobH5kjKTr6hhb5qmnWtFj1OVaW0+xvGTNhcLCrSGmvi7dlm2JYOSJR7iY1XQxz4lCovegYmCi37swTFF4NAzd198XgPA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1792688263; c=relaxed/simple; bh=kNRY+CatDDZJYcBjcj1oNEdPSWPGIiJNtBRyZa8Np58=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=CcDw+4uA8IH7XvMpzvw9HCjD0/mxBBYGrC6xQuKjE3QqimPKljIxysBJSSlDdb3Cby1/mr5rZ65gCqwoK9B8S+IsJgcLa7BdNJM8N/UyOkM6WnbP2NP37fMXggHf0nTZetGpmUbMlRRDEux7JieOMi72lPBF3+u3M/ZuRq0coSI= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0495A4BA2E06 Received: by simark.ca (Postfix) id 41E4E1E007; Thu, 22 Oct 2026 12:57:41 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [pushed] gdb: remove O_NOCTTY fallback definitions Date: Thu, 22 Oct 2026 12:57:37 -0400 Message-ID: <20261022165739.232325-1-simon.marchi@efficios.com> X-Mailer: git-send-email 2.56.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org 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 #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