Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfa] Always use O_NOCTTY when opening tty
@ 2004-08-11  5:57 Joel Brobecker
  2004-08-11  9:59 ` Mark Kettenis
  0 siblings, 1 reply; 2+ messages in thread
From: Joel Brobecker @ 2004-08-11  5:57 UTC (permalink / raw)
  To: gdb-patches

[-- 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);


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [rfa] Always use O_NOCTTY when opening tty
  2004-08-11  5:57 [rfa] Always use O_NOCTTY when opening tty Joel Brobecker
@ 2004-08-11  9:59 ` Mark Kettenis
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Kettenis @ 2004-08-11  9:59 UTC (permalink / raw)
  To: brobecker; +Cc: gdb-patches

   Date: Tue, 10 Aug 2004 22:57:12 -0700
   From: Joel Brobecker <brobecker@gnat.com>

   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).

Since you tested on a wide range of systems (thanks) I've committed
the patch.

   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.

Mark


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-08-11  9:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-11  5:57 [rfa] Always use O_NOCTTY when opening tty Joel Brobecker
2004-08-11  9:59 ` Mark Kettenis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox