┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2012-01-25 15:18:09 +0100
committerPeter Penz <[email protected]>2012-01-25 15:20:59 +0100
commit14d5a32475ef646e51f6750a80f216020b648039 (patch)
treed0088562072d6df9b9e4bbfb80d9c4fb1eb3a20a /src
parentfbb73966b2bd4158472d977914a134818f9cfd55 (diff)
Terminal: only consider process IDs > 0
Thanks to Jekyll Wu for the analyses. CCBUG: 286367
Diffstat (limited to 'src')
-rw-r--r--src/panels/terminal/terminalpanel.cpp5
1 files changed, 4 insertions, 1 deletions
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');