This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Add system(NULL) to fileio


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]