This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Add system(NULL) to fileio
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Nathan Sidwell <nathan at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Sat, 10 Jun 2006 10:37:14 +0300
- Subject: Re: Add system(NULL) to fileio
- References: <4489D824.40605@codesourcery.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Fri, 09 Jun 2006 21:20:52 +0100
> From: Nathan Sidwell <nathan@codesourcery.com>
>
> 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?