Merge lp:~dobey/ubuntu-app-launch/test-exit-code into lp:ubuntu-app-launch/15.04

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 190
Merged at revision: 190
Proposed branch: lp:~dobey/ubuntu-app-launch/test-exit-code
Merge into: lp:ubuntu-app-launch/15.04
Diff against target: 20 lines (+3/-2)
1 file modified
ubuntu-app-test/src/ubuntu-app-test.c (+3/-2)
To merge this branch: bzr merge lp:~dobey/ubuntu-app-launch/test-exit-code
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Alejandro J. Cura (community) Approve
Charles Kerr (community) Approve
Review via email: mp+252821@code.launchpad.net

Commit message

Save status from waitpid and exit with it.

To post a comment you must log in.
Revision history for this message
Charles Kerr (charlesk) wrote :

LGTM.

review: Approve
190. By dobey

Save status from waitpid and exit with it.

Revision history for this message
Alejandro J. Cura (alecu) wrote :

Looks better.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ubuntu-app-test/src/ubuntu-app-test.c'
--- ubuntu-app-test/src/ubuntu-app-test.c 2015-02-23 17:54:59 +0000
+++ ubuntu-app-test/src/ubuntu-app-test.c 2015-03-13 16:03:59 +0000
@@ -107,13 +107,14 @@
107 g_free(sock);107 g_free(sock);
108108
109 pid_t subpid = 0;109 pid_t subpid = 0;
110 int exit_status = -1;
110 if ((subpid = fork()) == 0) {111 if ((subpid = fork()) == 0) {
111 return execvp(argv[1], argv + 1);112 return execvp(argv[1], argv + 1);
112 }113 }
113 waitpid(subpid, NULL, 0);114 waitpid(subpid, &exit_status, 0);
114115
115 mir_prompt_session_release_sync(session);116 mir_prompt_session_release_sync(session);
116 mir_connection_release(mir);117 mir_connection_release(mir);
117118
118 return 0;119 return WEXITSTATUS(exit_status);
119}120}

Subscribers

People subscribed via source and target branches