From 3a84f2223b71dba0c6a2934b8c7cf443306f5a3b Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Wed, 25 Jan 2012 15:18:09 +0100 Subject: Terminal: only consider process IDs > 0 Thanks to Jekyll Wu for the analyses. CCBUG: 286367 --- src/panels/terminal/terminalpanel.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/panels/terminal/terminalpanel.cpp') diff --git a/src/panels/terminal/terminalpanel.cpp b/src/panels/terminal/terminalpanel.cpp index b3bf0506f..19c6cb1b7 100644 --- a/src/panels/terminal/terminalpanel.cpp +++ b/src/panels/terminal/terminalpanel.cpp @@ -127,7 +127,10 @@ void TerminalPanel::sendCdToTerminal(const QString& dir) // current line before sending a new input. This is mandatory, // otherwise sending a 'cd x' to a existing 'rm -rf *' might // result in data loss. As workaround SIGINT is send. - kill(m_terminal->terminalProcessId(), SIGINT); + const int processId = m_terminal->terminalProcessId(); + if (processId > 0) { + kill(processId, SIGINT); + } } m_terminal->sendInput("cd " + KShell::quoteArg(dir) + '\n'); -- cgit v1.3