Merge lp:~xnox/upstart/async-asserts into lp:upstart

Proposed by Dimitri John Ledkov on 2014-06-04
Status: Merged
Merged at revision: 1625
Proposed branch: lp:~xnox/upstart/async-asserts
Merge into: lp:upstart
Diff against target: 38 lines (+11/-3)
2 files modified
init/job.c (+8/-1)
init/job_process.c (+3/-2)
To merge this branch: bzr merge lp:~xnox/upstart/async-asserts
Reviewer Review Type Date Requested Status
James Hunt 2014-06-04 Approve on 2014-06-04
Review via email: mp+222026@code.launchpad.net
To post a comment you must log in.
James Hunt (jamesodhunt) wrote :

LGTM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'init/job.c'
2--- init/job.c 2014-06-04 10:38:06 +0000
3+++ init/job.c 2014-06-04 11:56:15 +0000
4@@ -380,11 +380,18 @@
5 {
6 nih_assert (job != NULL);
7
8+ /* We may not be blocked by any events when doing first
9+ * transition */
10+ nih_assert (job->blocker == NULL);
11+
12 while (job->state != state) {
13 JobState old_state;
14 int unused;
15
16- nih_assert (job->blocker == NULL);
17+ /* If we got blocked during async spawns, stop
18+ * transitions */
19+ if (job->blocker)
20+ return;
21
22 nih_info (_("%s state changed from %s to %s"), job_name (job),
23 job_state_name (job->state), job_state_name (state));
24
25=== modified file 'init/job_process.c'
26--- init/job_process.c 2014-05-21 22:03:40 +0000
27+++ init/job_process.c 2014-06-04 11:56:15 +0000
28@@ -2476,8 +2476,9 @@
29
30 if (job && job->state == JOB_SPAWNED) {
31 if (job->class->expect == EXPECT_NONE) {
32- nih_assert (process == PROCESS_MAIN);
33- job_change_state (job, job_next_state (job));
34+ if (process == PROCESS_MAIN) {
35+ job_change_state (job, job_next_state (job));
36+ }
37 }
38 }
39

Subscribers

People subscribed via source and target branches