Merge lp:~afrantzis/unity-system-compositor/no-external-spinner-zombie-processes-sigchld into lp:unity-system-compositor

Proposed by Alexandros Frantzis
Status: Superseded
Proposed branch: lp:~afrantzis/unity-system-compositor/no-external-spinner-zombie-processes-sigchld
Merge into: lp:unity-system-compositor
Diff against target: 34 lines (+17/-0)
1 file modified
src/external_spinner.cpp (+17/-0)
To merge this branch: bzr merge lp:~afrantzis/unity-system-compositor/no-external-spinner-zombie-processes-sigchld
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Unity System Compositor Development Team Pending
Review via email: mp+264410@code.launchpad.net

This proposal has been superseded by a proposal from 2015-07-10.

Commit message

Don't leave zombie spinner processes

Description of the change

Don't leave zombie spinner processes

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Unmerged revisions

224. By Alexandros Frantzis

Don't leave zombie spinner processes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/external_spinner.cpp'
2--- src/external_spinner.cpp 2015-04-01 17:06:16 +0000
3+++ src/external_spinner.cpp 2015-07-10 12:07:43 +0000
4@@ -20,6 +20,18 @@
5
6 #include <unistd.h>
7 #include <signal.h>
8+#include <sys/wait.h>
9+
10+namespace
11+{
12+
13+void wait_for_child(int)
14+{
15+ while (waitpid(-1, nullptr, WNOHANG) > 0)
16+ continue;
17+}
18+
19+}
20
21 usc::ExternalSpinner::ExternalSpinner(
22 std::string const& executable,
23@@ -28,6 +40,11 @@
24 mir_socket{mir_socket},
25 spinner_pid{0}
26 {
27+ struct sigaction sa;
28+ sigfillset(&sa.sa_mask);
29+ sa.sa_handler = wait_for_child;
30+ sa.sa_flags = 0;
31+ sigaction(SIGCHLD, &sa, nullptr);
32 }
33
34 usc::ExternalSpinner::~ExternalSpinner()

Subscribers

People subscribed via source and target branches