implemented partial closing for rwpipe

This commit is contained in:
2009-08-28 06:52:20 +00:00
parent 9d635709f3
commit 81b3d369e8
6 changed files with 116 additions and 45 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: StdAwk.cpp 258 2009-08-19 14:04:15Z hyunghwan.chung $
* $Id: StdAwk.cpp 271 2009-08-27 12:52:20Z hyunghwan.chung $
*
Copyright 2006-2009 Chung, Hyung-Hwan.
@ -315,7 +315,26 @@ int StdAwk::openPipe (Pipe& io)
int StdAwk::closePipe (Pipe& io)
{
qse_pio_close ((qse_pio_t*)io.getHandle());
qse_pio_t* pio = (qse_pio_t*)io.getHandle();
if (io.getMode() == Awk::Pipe::RW)
{
#if 0
TODO: support partial close....
rwcopt = io.getCloseRW();
if (rwcopt == Awk::Pipe::CLOSE_R)
{
qse_pio_end (pio, QSE_PIO_IN);
return 0;
}
else if (rwcopt == Awk::Pipe::CLOSE_W)
{
qse_pio_end (pio, QSE_PIO_OUT);
return 0;
}
#endif
}
qse_pio_close (pio);
return 0;
}