From 00281711d9c47a07c8c54fe6d11fa8562fd8dea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Fl=C3=B6ser?= Date: Sun, 6 Aug 2017 20:56:13 +0200 Subject: [PATCH] Handle processId being 0 in ShellClient::killWindow Summary: If ClientConnection fails to get the process id (which happens at least on FreeBSD) the process id is 0. We should not try to terminate this pid as it terminates all processes is KWin's process group which is the whole session. Test Plan: Only compile test Reviewers: #kwin, #plasma Subscribers: plasma-devel, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D7168 --- shell_client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell_client.cpp b/shell_client.cpp index f5fab5338d..58ba2165fb 100644 --- a/shell_client.cpp +++ b/shell_client.cpp @@ -1477,7 +1477,7 @@ void ShellClient::killWindow() return; } auto c = surface()->client(); - if (c->processId() == getpid()) { + if (c->processId() == getpid() || c->processId() == 0) { c->destroy(); return; }