From: Joel Brobecker <brobecker@gnat.com>
To: gdb-patches@sources.redhat.com
Subject: [rfa] Always use O_NOCTTY when opening tty
Date: Wed, 11 Aug 2004 05:57:00 -0000 [thread overview]
Message-ID: <20040811055712.GB25562@gnat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1300 bytes --]
Based on a tip from MarkK, I tried removing the conditionalization
on USE_O_NOCTTY in inflow.c when opening a tty:
http://sources.redhat.com/ml/gdb-patches/2004-08/msg00244.html
So I tested a simplified[1] version of Mark's patch on the following
systems: - x86-linux
- sparc-solaris 2.5 and 2.8
- hppa-hpux 11.00
- alpha-osf 4.0f and 5.1a
- ppc-aix 4.3.2 and 5.1
- mips-irix 6.5
No regression.
So I would like Mark's patch to be committed asap, so we can rid
ourselves of the last xm file immediately after that (actually, there
is the ptrace patch too, but this one is close to being committed,
I think). Mark's patch copied here, for your convenience:
2004-08-10 Mark Kettenis <kettenis@gnu.org>
* inflow.c (O_NOCTTY): Define to zero if not already defined.
(new_tty): Use O_NOCTTY unconditionally.
Once Mark has committed this patch, I will remove all traces of
USE_NOCTTY (including in the doc).
Thanks,
--
Joel
[1]: Unfortunately, I tested the same patch as Mark's, except that
I forgot the following hunk:
+#ifndef O_NOCTTY
+#define O_NOCTTY 0
+#endif
So technically, I didn't test the same patch. But I did test
the principle (of using O_NOCTTY regardless of the host).
[-- Attachment #2: inflow.c.diff --]
[-- Type: text/plain, Size: 813 bytes --]
Index: inflow.c
===================================================================
RCS file: /cvs/src/src/gdb/inflow.c,v
retrieving revision 1.23
diff -u -p -r1.23 inflow.c
--- inflow.c 30 Jul 2004 12:05:44 -0000 1.23
+++ inflow.c 8 Aug 2004 11:47:51 -0000
@@ -42,6 +42,10 @@
#include <sys/ioctl.h>
#endif
+#ifndef O_NOCTTY
+#define O_NOCTTY 0
+#endif
+
#if defined (SIGIO) && defined (FASYNC) && defined (FD_SET) && defined (F_SETOWN)
static void handle_sigio (int);
#endif
@@ -537,12 +541,7 @@ new_tty (void)
#endif
/* Now open the specified new terminal. */
-
-#ifdef USE_O_NOCTTY
tty = open (inferior_thisrun_terminal, O_RDWR | O_NOCTTY);
-#else
- tty = open (inferior_thisrun_terminal, O_RDWR);
-#endif
if (tty == -1)
{
print_sys_errmsg (inferior_thisrun_terminal, errno);
next reply other threads:[~2004-08-11 5:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-11 5:57 Joel Brobecker [this message]
2004-08-11 9:59 ` Mark Kettenis
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=20040811055712.GB25562@gnat.com \
--to=brobecker@gnat.com \
--cc=gdb-patches@sources.redhat.com \
/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