aboutsummaryrefslogtreecommitdiff
path: root/lib/base/console.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/base/console.cpp')
-rw-r--r--lib/base/console.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/base/console.cpp b/lib/base/console.cpp
index 635d1145..f6e8763f 100644
--- a/lib/base/console.cpp
+++ b/lib/base/console.cpp
@@ -200,7 +200,7 @@ int eConsoleAppContainer::execute( const std::string &cmd )
if ( pid == -1 )
return -3;
- eDebug("pipe in = %d, out = %d, err = %d", fd[0], fd[1], fd[2]);
+// eDebug("pipe in = %d, out = %d, err = %d", fd[0], fd[1], fd[2]);
in = new eSocketNotifier(eApp, fd[0], POLLIN|POLLPRI|POLLHUP );
out = new eSocketNotifier(eApp, fd[1], POLLOUT, false);
@@ -218,7 +218,7 @@ eConsoleAppContainer::~eConsoleAppContainer()
void eConsoleAppContainer::kill()
{
- if ( killstate != -1 )
+ if ( killstate != -1 && pid != -1 )
{
eDebug("user kill(SIGKILL) console App");
killstate=-1;
@@ -239,7 +239,7 @@ void eConsoleAppContainer::kill()
void eConsoleAppContainer::sendCtrlC()
{
- if ( killstate != -1 )
+ if ( killstate != -1 && pid != -1 )
{
eDebug("user send SIGINT(Ctrl-C) to console App");
::kill(pid, SIGINT);
@@ -276,6 +276,7 @@ void eConsoleAppContainer::closePipes()
outbuf.pop();
delete [] d.data;
}
+ pid = -1;
}
void eConsoleAppContainer::readyRead(int what)