diff options
-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 |