git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
do some initializations
[enigma2.git]
/
lib
/
base
/
console.cpp
diff --git
a/lib/base/console.cpp
b/lib/base/console.cpp
index b3fbbf7368a917861cf75d5ed281ec0785010356..f49c7c4c045e441815fb85f67968af60dabdb41c 100644
(file)
--- a/
lib/base/console.cpp
+++ b/
lib/base/console.cpp
@@
-49,7
+49,7
@@
int bidirpipe(int pfd[], char *cmd , char *argv[])
}
eConsoleAppContainer::eConsoleAppContainer()
}
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;
{
for (int i=0; i < 3; ++i)
fd[i]=-1;
@@
-244,15
+244,27
@@
void eConsoleAppContainer::sendCtrlC()
void eConsoleAppContainer::closePipes()
{
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
{
eDebug("pipes closed");
while( outbuf.size() ) // cleanup out buffer
{