diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-02-22 14:14:17 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-02-22 14:14:17 +0000 |
| commit | 12cdc06475b594cf6559a06f6cf9f214b516758d (patch) | |
| tree | aa80c3e42a85723a5c955fbf87c7f37d5b92a2df /lib/base/console.cpp | |
| parent | 572ad1d30a4ac4fe564f4a99e81fa60f947fc21c (diff) | |
| download | enigma2-12cdc06475b594cf6559a06f6cf9f214b516758d.tar.gz enigma2-12cdc06475b594cf6559a06f6cf9f214b516758d.zip | |
do some initializations
Diffstat (limited to 'lib/base/console.cpp')
| -rw-r--r-- | lib/base/console.cpp | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/lib/base/console.cpp b/lib/base/console.cpp index b3fbbf73..f49c7c4c 100644 --- a/lib/base/console.cpp +++ b/lib/base/console.cpp @@ -49,7 +49,7 @@ int bidirpipe(int pfd[], char *cmd , char *argv[]) } eConsoleAppContainer::eConsoleAppContainer() -:pid(-1), killstate(0) +:pid(-1), killstate(0), in(0), out(0), err(0) { for (int i=0; i < 3; ++i) fd[i]=-1; @@ -244,15 +244,27 @@ void eConsoleAppContainer::sendCtrlC() void eConsoleAppContainer::closePipes() { - in->stop(); - out->stop(); - err->stop(); - ::close(fd[0]); - fd[0]=-1; - ::close(fd[1]); - fd[1]=-1; - ::close(fd[2]); - fd[2]=-1; + if (in) + in->stop(); + if (out) + out->stop(); + if (err) + err->stop(); + if (fd[0] != -1) + { + ::close(fd[0]); + fd[0]=-1; + } + if (fd[1] != -1) + { + ::close(fd[1]); + fd[1]=-1; + } + if (fd[2] != -1) + { + ::close(fd[2]); + fd[2]=-1; + } eDebug("pipes closed"); while( outbuf.size() ) // cleanup out buffer { |
