From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6539 invoked by alias); 10 Jun 2006 07:37:45 -0000 Received: (qmail 6509 invoked by uid 22791); 10 Jun 2006 07:37:43 -0000 X-Spam-Check-By: sourceware.org Received: from nitzan.inter.net.il (HELO nitzan.inter.net.il) (192.114.186.20) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 10 Jun 2006 07:37:24 +0000 Received: from HOME-C4E4A596F7 (IGLD-80-230-164-172.inter.net.il [80.230.164.172]) by nitzan.inter.net.il (MOS 3.7.3-GA) with ESMTP id DRG02121 (AUTH halo1); Sat, 10 Jun 2006 10:37:16 +0300 (IDT) Date: Sat, 10 Jun 2006 07:37:00 -0000 Message-Id: From: Eli Zaretskii To: Nathan Sidwell CC: gdb-patches@sourceware.org In-reply-to: <4489D824.40605@codesourcery.com> (message from Nathan Sidwell on Fri, 09 Jun 2006 21:20:52 +0100) Subject: Re: Add system(NULL) to fileio Reply-to: Eli Zaretskii References: <4489D824.40605@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-06/txt/msg00120.txt.bz2 > Date: Fri, 09 Jun 2006 21:20:52 +0100 > From: Nathan Sidwell > > Tested with a modified libgloss for an m68k target. ok? Thanks. The patch to gdb.texinfo is approved, conditioned on the approval of the code patch, provided that you take care of the comment below: > ! If @var{len} is zero, the return value indicates whether a shell is > ! available. Zero indicates it is not available and non-zero indicates ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I suggest "A zero return value indicates a shell is not available..." I think this makes the text less ambiguous. > *** gdb/testsuite/gdb.base/fileio.c 5 Jun 2006 15:36:02 -0000 1.8.12.1 > --- gdb/testsuite/gdb.base/fileio.c 9 Jun 2006 15:12:57 -0000 > *************** test_system () > *** 385,390 **** > --- 385,394 ---- > ret = system ("wrtzlpfrmpft"); > printf ("system 2: ret = %d %s\n", ret, WEXITSTATUS (ret) == 127 ? "OK" : ""); > stop (); > + /* Test for shell */ > + ret = system (NULL); > + printf ("system 3: ret = %d %s\n", ret, ret != 0 ? "OK" : ""); > + stop (); Isn't it better to test for shell availability _before_ we send it commands, not after?