Add system(NULL) to fileio

Eli Zaretskii eliz@gnu.org
Sat Jun 10 07:37:00 GMT 2006


> 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?



More information about the Gdb-patches mailing list