diff options
author | Mark Mitchell <mark@codesourcery.com> | 2005-01-05 16:13:46 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2005-01-05 16:13:46 +0000 |
commit | 5cfa47941f2c433f25c69bd5db4dd8749d56b771 (patch) | |
tree | d00ed8aa05f3ba2d08de140dae0259b566de1c77 /libstdc++-v3 | |
parent | 9143de5c0185332e852f3d3167a7d6c8ae0b2514 (diff) | |
download | gcc-5cfa47941f2c433f25c69bd5db4dd8749d56b771.zip gcc-5cfa47941f2c433f25c69bd5db4dd8749d56b771.tar.gz gcc-5cfa47941f2c433f25c69bd5db4dd8749d56b771.tar.bz2 |
9507.cc: Remove child process.
* testsuite/27_io/basic_filebuf/open/char/9507.cc: Remove child
process.
From-SVN: r92953
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 5 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/9507.cc | 20 |
2 files changed, 11 insertions, 14 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 8322d5f..521f8fb 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2005-01-05 Mark Mitchell <mark@codesourcery.com> + + * testsuite/27_io/basic_filebuf/open/char/9507.cc: Remove child + process. + 2005-01-05 Paolo Carlini <pcarlini@suse.de> * src/istream.cc (basic_istream<char>::ignore(streamsize), diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/9507.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/9507.cc index 775c72c..eacf8fa 100644 --- a/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/9507.cc +++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/9507.cc @@ -37,33 +37,25 @@ void test_06() using namespace __gnu_test; bool test __attribute__((unused)) = true; const char* name = "tmp_fifo2"; - semaphore s1, s2; signal(SIGPIPE, SIG_IGN); unlink(name); try_mkfifo(name, S_IRWXU); - if (!fork()) - { - std::filebuf fbuf; - fbuf.open(name, std::ios_base::in); - fbuf.sgetc(); - s1.signal (); - fbuf.close(); - s2.wait (); - exit(0); - } - std::filebuf fbuf; + // The use of ios_base::ate implies an attempt to seek on the file + // descriptor. The seek will fail. Thus, at the OS level, this + // call to "fbuf.open" will result in a call to "open" (which will + // succeed), a call to "lseek" (which will fail), and, finally, a + // call to "close" (which will succeed). Thus, after this call, the + // file should be closed. std::filebuf* r = fbuf.open(name, std::ios_base::in | std::ios_base::out | std::ios_base::ate); - s1.wait (); VERIFY( !fbuf.is_open() ); VERIFY( r == NULL ); - s2.signal (); } int |