From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18082 invoked by alias); 11 Aug 2004 05:57:16 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 18061 invoked from network); 11 Aug 2004 05:57:13 -0000 Received: from unknown (HELO takamaka.act-europe.fr) (142.179.108.108) by sourceware.org with SMTP; 11 Aug 2004 05:57:13 -0000 Received: by takamaka.act-europe.fr (Postfix, from userid 507) id D781147D91; Tue, 10 Aug 2004 22:57:12 -0700 (PDT) Date: Wed, 11 Aug 2004 05:57:00 -0000 From: Joel Brobecker To: gdb-patches@sources.redhat.com Subject: [rfa] Always use O_NOCTTY when opening tty Message-ID: <20040811055712.GB25562@gnat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="3V7upXqbjpZ4EhLz" Content-Disposition: inline User-Agent: Mutt/1.4i X-SW-Source: 2004-08/txt/msg00386.txt.bz2 --3V7upXqbjpZ4EhLz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1300 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 * 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). --3V7upXqbjpZ4EhLz Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="inflow.c.diff" Content-length: 813 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 #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); --3V7upXqbjpZ4EhLz--