Merge lp:~gerboland/platform-api/hangup-on-mirconnection-lost into lp:platform-api

Proposed by Gerry Boland on 2016-09-12
Status: Merged
Approved by: Gerry Boland on 2016-09-12
Approved revision: 320
Merged at revision: 333
Proposed branch: lp:~gerboland/platform-api/hangup-on-mirconnection-lost
Merge into: lp:platform-api
Diff against target: 25 lines (+6/-2)
1 file modified
src/ubuntu/application/common/mirclient/ubuntu_application_api_mirclient.cpp (+6/-2)
To merge this branch: bzr merge lp:~gerboland/platform-api/hangup-on-mirconnection-lost
Reviewer Review Type Date Requested Status
Chris Halse Rogers 2016-09-12 Approve on 2016-09-12
Review via email: mp+305540@code.launchpad.net

Commit message

Raise SIGHUP on Mir connection loss

If the connection to the Mir server fails, signal hangup to the client. Otherwise it will have no idea and just keep spinning (example Qt clients)

To post a comment you must log in.
Chris Halse Rogers (raof) wrote :

Sure, that's acceptable.

review: Approve
Gerry Boland (gerboland) wrote :

I'll take that, thanks!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/ubuntu/application/common/mirclient/ubuntu_application_api_mirclient.cpp'
2--- src/ubuntu/application/common/mirclient/ubuntu_application_api_mirclient.cpp 2015-07-06 17:53:00 +0000
3+++ src/ubuntu/application/common/mirclient/ubuntu_application_api_mirclient.cpp 2016-09-12 23:12:55 +0000
4@@ -30,6 +30,8 @@
5 #include <stdlib.h>
6 #include <assert.h>
7 #include <string.h>
8+#include <signal.h>
9+#include <unistd.h>
10
11 namespace uam = ubuntu::application::mir;
12 namespace uamc = uam::client;
13@@ -56,8 +58,10 @@
14 delegate->resumed_cb(nullptr, c_ctx);
15 break;
16 }
17- default:
18- break;
19+ case mir_lifecycle_connection_lost:
20+ {
21+ kill(getpid(), SIGHUP);
22+ }
23 }
24 }
25 };

Subscribers

People subscribed via source and target branches