From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29153 invoked by alias); 8 Apr 2002 15:37:45 -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 28841 invoked from network); 8 Apr 2002 15:37:44 -0000 Received: from unknown (HELO cerbere.u-strasbg.fr) (130.79.112.7) by sources.redhat.com with SMTP; 8 Apr 2002 15:37:44 -0000 Received: from laocoon (laocoon.u-strasbg.fr [130.79.112.72]) by cerbere.u-strasbg.fr (8.9.3/8.8.7) with ESMTP id RAA24923 for ; Mon, 8 Apr 2002 17:37:40 +0200 Message-Id: <4.2.0.58.20020408173511.01e73da8@ics.u-strasbg.fr> X-Sender: muller@ics.u-strasbg.fr Date: Mon, 08 Apr 2002 08:37:00 -0000 To: gdb-patches@sources.redhat.com From: Pierre Muller Subject: [RFA] apply shell fix for win32-nat.c in 5.2 branch Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=====================_544513268==_" X-SW-Source: 2002-04/txt/msg00300.txt.bz2 --=====================_544513268==_ Content-Type: text/plain; charset="us-ascii" Content-length: 670 This patch was applied previoulsy to the main branch by Christopher Faylor. It disables shell use unless explicitly enabled. As shell use is still experimental and has several problems, I think that this must also be applied to 5.2 branch. As Christopher asked me to do this, the RFA is mainly about the format of the ChangeLog entry... ChangeLog entry: 2002-04-08 Pierre Muller from 2002-03-22 Christopher Faylor patch in main branch. * win32-nat.c (child_create_inferior): Check for proper shell to use here, in case the user changes it on the fly. (_initialize_inftarg): Remove shell path considerations. --=====================_544513268==_ Content-Type: text/plain; charset="us-ascii" Content-Disposition: attachment; filename="win32-nat.diff2" Content-length: 1445 Index: win32-nat.c =================================================================== RCS file: /cvs/src/src/gdb/win32-nat.c,v retrieving revision 1.56 diff -r1.56 win32-nat.c 126c126,127 < static DWORD main_thread_id; /* Thread ID of the main thread */ --- > static DWORD main_thread_id; /* Thread ID of the main thread */ > static pid_t cygwin_pid; /* pid of cygwin process */ 142,144d142 < /* Path to shell */ < static char shell[MAX_PATH + 1]; < 1463a1462,1463 > char shell[MAX_PATH + 1]; /* Path to shell */ > const char *sh; 1471c1471 < if (!useshell || !shell[0]) --- > if (!useshell) 1479,1480c1479,1485 < char *newallargs = alloca (sizeof (" -c 'exec '") + strlen (exec_file) < + strlen (allargs) + 2); --- > char *newallargs; > sh = getenv ("SHELL"); > if (!sh) > sh = "/bin/sh"; > cygwin_conv_to_win32_path (sh, shell); > newallargs = alloca (sizeof (" -c 'exec '") + strlen (exec_file) > + strlen (allargs) + 2); 1500c1505 < /* This code use to assume all env vars were file names and would --- > /* This code used to assume all env vars were file names and would 1816d1820 < const char *sh; 1823,1836d1826 < < sh = getenv ("SHELL"); < if (!sh) < sh = "/bin/sh"; < if (access (sh, X_OK) != 0) < { < shell[0] = '\0'; < useshell = 0; < } < else < { < cygwin_conv_to_win32_path (sh, shell); < useshell = 1; < } --=====================_544513268==_ Content-Type: text/plain; charset="us-ascii" Content-length: 176 Pierre Muller Institut Charles Sadron 6,rue Boussingault F 67083 STRASBOURG CEDEX (France) mailto:muller@ics.u-strasbg.fr Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99 --=====================_544513268==_--