From 67cd4d5af656603770e61f8ce8dacf7422d246aa Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Thu, 23 Feb 2006 02:17:26 +0000 Subject: [PATCH 1/1] dont kill pid -1 --- lib/base/console.cpp | 7 ++++--- 1 file 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) -- 2.30.2