Merge lp:~townsend/libertine/fix-pasted-crash into lp:libertine

Proposed by Christopher Townsend
Status: Merged
Approved by: Larry Price
Approved revision: 444
Merged at revision: 443
Proposed branch: lp:~townsend/libertine/fix-pasted-crash
Merge into: lp:libertine
Diff against target: 42 lines (+25/-0)
1 file modified
pasted/pasted.cpp (+25/-0)
To merge this branch: bzr merge lp:~townsend/libertine/fix-pasted-crash
Reviewer Review Type Date Requested Status
Libertine CI Bot continuous-integration Approve
Larry Price Approve
Review via email: mp+320394@code.launchpad.net

Commit message

When starting pasted, ensure DISPLAY is set and valid before continuing to run.

To post a comment you must log in.
Revision history for this message
Libertine CI Bot (libertine-ci-bot) wrote :

PASSED: Continuous integration, rev:443
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/474/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/libertine/job/build/866
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=default/716
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=zesty,testname=default/716
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=xenial+overlay,testname=default/716
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=zesty,testname=default/716
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-0-fetch/876
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/868
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/868/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=zesty/868
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=zesty/868/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/868
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/868/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=zesty/868
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=zesty/868/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/474/rebuild

review: Approve (continuous-integration)
Revision history for this message
Larry Price (larryprice) wrote :

inlines

review: Needs Information
444. By Christopher Townsend

Changes base on review feddback.

Revision history for this message
Larry Price (larryprice) wrote :

good, thanks

review: Approve
Revision history for this message
Libertine CI Bot (libertine-ci-bot) wrote :

PASSED: Continuous integration, rev:444
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/476/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/libertine/job/build/868
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=default/718
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=zesty,testname=default/718
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=xenial+overlay,testname=default/718
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=zesty,testname=default/718
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-0-fetch/878
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/870
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/870/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=zesty/870
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=zesty/870/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/870
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/870/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=zesty/870
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=zesty/870/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/476/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'pasted/pasted.cpp'
2--- pasted/pasted.cpp 2016-09-12 17:59:56 +0000
3+++ pasted/pasted.cpp 2017-03-20 19:23:05 +0000
4@@ -66,6 +66,29 @@
5 return persistentSurfaceId;
6 }
7
8+
9+void checkXServer()
10+{
11+ char *display = getenv("DISPLAY");
12+
13+ if (display == nullptr)
14+ {
15+ qCritical() << "DISPLAY environment variable not set!";
16+ exit(-1);
17+ }
18+
19+ Display *dpy = XOpenDisplay(display);
20+ if (dpy == nullptr)
21+ {
22+ qCritical() << "Xmir is not running on DISPLAY" << display << "!";
23+ exit(-1);
24+ }
25+
26+ XCloseDisplay(dpy);
27+
28+ return;
29+}
30+
31 } //anonymous namespace
32
33
34@@ -252,6 +275,8 @@
35 {
36 qSetMessagePattern(QString("%{appname}: %{message}"));
37
38+ checkXServer();
39+
40 Pasted pasted(argc, argv);
41
42 QThread t;

Subscribers

People subscribed via source and target branches