Commit 5cfa4794 by Mark Mitchell Committed by Mark Mitchell

9507.cc: Remove child process.

	* testsuite/27_io/basic_filebuf/open/char/9507.cc: Remove child
	process.

From-SVN: r92953
parent 9143de5c
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),
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment