]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Terminal: only consider process IDs > 0
authorPeter Penz <peter.penz19@gmail.com>
Wed, 25 Jan 2012 14:18:09 +0000 (15:18 +0100)
committerPeter Penz <peter.penz19@gmail.com>
Wed, 25 Jan 2012 14:20:59 +0000 (15:20 +0100)
Thanks to Jekyll Wu for the analyses.

CCBUG: 286367

src/panels/terminal/terminalpanel.cpp

index b3bf0506f236c6e6312189aca3adb08a78ca7fcf..19c6cb1b7b2bd8af53ed934d3483164dad9332e4 100644 (file)
@@ -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');