summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Penz <peter.penz19@gmail.com>2012-01-25 14:18:09 (GMT)
committerPeter Penz <peter.penz19@gmail.com>2012-01-25 14:20:17 (GMT)
commit7dfe3632f52d30f79f1c21c9acbaf68c05d63006 (patch)
tree71f6b56e8cdd34ef584a2722f705e84e635452c8
parent84a9cc4bf6e9decc4c102102c4b04162369eb0fe (diff)
Terminal: only consider process IDs > 0
Thanks to Jekyll Wu for the analyses. CCBUG: 286367
-rw-r--r--dolphin/src/panels/terminal/terminalpanel.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/dolphin/src/panels/terminal/terminalpanel.cpp b/dolphin/src/panels/terminal/terminalpanel.cpp
index b3bf050..19c6cb1 100644
--- a/dolphin/src/panels/terminal/terminalpanel.cpp
+++ b/dolphin/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');