chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6c07308
)
unit: make sure a job for a service of type 'finish' succeeds if the process terminat...
author
Lennart Poettering
<lennart@poettering.net>
Wed, 11 Aug 2010 02:02:58 +0000
(
04:02
+0200)
committer
Lennart Poettering
<lennart@poettering.net>
Wed, 11 Aug 2010 02:03:13 +0000
(
04:03
+0200)
src/unit.c
patch
|
blob
|
history
diff --git
a/src/unit.c
b/src/unit.c
index 881f91a677880a30fb1728f98373393c748d29f1..b93777bec68dac245d3d3a87b5d7a036c43278dc 100644
(file)
--- a/
src/unit.c
+++ b/
src/unit.c
@@
-1034,7
+1034,9
@@
void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns) {
job_finish_and_invalidate(u->meta.job, true);
else if (u->meta.job->state == JOB_RUNNING && ns != UNIT_ACTIVATING) {
unexpected = true;
job_finish_and_invalidate(u->meta.job, true);
else if (u->meta.job->state == JOB_RUNNING && ns != UNIT_ACTIVATING) {
unexpected = true;
- job_finish_and_invalidate(u->meta.job, false);
+
+ if (UNIT_IS_INACTIVE_OR_MAINTENANCE(ns))
+ job_finish_and_invalidate(u->meta.job, ns != UNIT_MAINTENANCE);
}
break;
}
break;
@@
-1047,7
+1049,9
@@
void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns) {
job_finish_and_invalidate(u->meta.job, true);
else if (ns != UNIT_ACTIVATING && ns != UNIT_RELOADING) {
unexpected = true;
job_finish_and_invalidate(u->meta.job, true);
else if (ns != UNIT_ACTIVATING && ns != UNIT_RELOADING) {
unexpected = true;
- job_finish_and_invalidate(u->meta.job, false);
+
+ if (UNIT_IS_INACTIVE_OR_MAINTENANCE(ns))
+ job_finish_and_invalidate(u->meta.job, ns != UNIT_MAINTENANCE);
}
}
}
}
@@
-1057,7
+1061,7
@@
void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns) {
case JOB_RESTART:
case JOB_TRY_RESTART:
case JOB_RESTART:
case JOB_TRY_RESTART:
- if (
ns == UNIT_INACTIVE || ns == UNIT_MAINTENANCE
)
+ if (
UNIT_IS_INACTIVE_OR_MAINTENANCE(ns)
)
job_finish_and_invalidate(u->meta.job, true);
else if (u->meta.job->state == JOB_RUNNING && ns != UNIT_DEACTIVATING) {
unexpected = true;
job_finish_and_invalidate(u->meta.job, true);
else if (u->meta.job->state == JOB_RUNNING && ns != UNIT_DEACTIVATING) {
unexpected = true;