diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2006-06-13 08:55:22 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@codesourcery.com> | 2006-06-13 08:55:22 +0000 |
commit | 5600ea19e0ff645c85a8719648655c2e7b2e4717 (patch) | |
tree | 606de62b7a27178ba351bec8d579244edb0c0ac1 /gdb/testsuite/gdb.base/fileio.c | |
parent | e1c2defab5219dd0aa2a64d865e78d9ac736d0ac (diff) | |
download | gdb-5600ea19e0ff645c85a8719648655c2e7b2e4717.zip gdb-5600ea19e0ff645c85a8719648655c2e7b2e4717.tar.gz gdb-5600ea19e0ff645c85a8719648655c2e7b2e4717.tar.bz2 |
gdb/
* remote-file.io.c (remote_fileio_func_system): Treat zero length
string as NULL. Adjust for NULL pointer argument.
* doc/gdb.texinfo (system): Document behaviour with zero length
string.
gdb/testsuite/
* gdb.base/fileio.c: Add system(NULL) test.
* gdb.base/fileio.exp: Check it.
Diffstat (limited to 'gdb/testsuite/gdb.base/fileio.c')
-rw-r--r-- | gdb/testsuite/gdb.base/fileio.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gdb/testsuite/gdb.base/fileio.c b/gdb/testsuite/gdb.base/fileio.c index f0883c6..3910da5 100644 --- a/gdb/testsuite/gdb.base/fileio.c +++ b/gdb/testsuite/gdb.base/fileio.c @@ -373,17 +373,21 @@ test_system () int ret; char sys[512]; + /* Test for shell */ + ret = system (NULL); + printf ("system 1: ret = %d %s\n", ret, ret != 0 ? "OK" : ""); + stop (); /* This test prepares the directory for test_rename() */ sprintf (sys, "mkdir -p %s %s", TESTSUBDIR, TESTDIR2); ret = system (sys); if (ret == 127) - printf ("system 1: ret = %d /bin/sh unavailable???\n", ret); + printf ("system 2: ret = %d /bin/sh unavailable???\n", ret); else - printf ("system 1: ret = %d %s\n", ret, ret == 0 ? "OK" : ""); + printf ("system 2: ret = %d %s\n", ret, ret == 0 ? "OK" : ""); stop (); /* Invalid command (just guessing ;-) ) */ ret = system ("wrtzlpfrmpft"); - printf ("system 2: ret = %d %s\n", ret, WEXITSTATUS (ret) == 127 ? "OK" : ""); + printf ("system 3: ret = %d %s\n", ret, WEXITSTATUS (ret) == 127 ? "OK" : ""); stop (); } |