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
=== modified file 'pasted/pasted.cpp'
--- pasted/pasted.cpp 2016-09-12 17:59:56 +0000
+++ pasted/pasted.cpp 2017-03-20 19:23:05 +0000
@@ -66,6 +66,29 @@
66 return persistentSurfaceId;66 return persistentSurfaceId;
67}67}
6868
69
70void checkXServer()
71{
72 char *display = getenv("DISPLAY");
73
74 if (display == nullptr)
75 {
76 qCritical() << "DISPLAY environment variable not set!";
77 exit(-1);
78 }
79
80 Display *dpy = XOpenDisplay(display);
81 if (dpy == nullptr)
82 {
83 qCritical() << "Xmir is not running on DISPLAY" << display << "!";
84 exit(-1);
85 }
86
87 XCloseDisplay(dpy);
88
89 return;
90}
91
69} //anonymous namespace92} //anonymous namespace
7093
7194
@@ -252,6 +275,8 @@
252{275{
253 qSetMessagePattern(QString("%{appname}: %{message}"));276 qSetMessagePattern(QString("%{appname}: %{message}"));
254277
278 checkXServer();
279
255 Pasted pasted(argc, argv);280 Pasted pasted(argc, argv);
256281
257 QThread t;282 QThread t;

Subscribers

People subscribed via source and target branches