chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
unit: add DefaultDependencies= setting
[elogind.git]
/
src
/
job.c
diff --git
a/src/job.c
b/src/job.c
index 9937ed735b6bffd107c3043559e67fc77f8da729..31e9cfe8d6f937ddf7973548c599f2c0d64283cb 100644
(file)
--- a/
src/job.c
+++ b/
src/job.c
@@
-56,7
+56,7
@@
void job_free(Job *j) {
/* Detach from next 'bigger' objects */
if (j->installed) {
/* Detach from next 'bigger' objects */
if (j->installed) {
- bus_job_send_removed_signal(j);
+ bus_job_send_removed_signal(j
, !j->failed
);
if (j->unit->meta.job == j) {
j->unit->meta.job = NULL;
if (j->unit->meta.job == j) {
j->unit->meta.job = NULL;
@@
-275,25
+275,26
@@
bool job_type_is_redundant(JobType a, UnitActiveState b) {
case JOB_START:
return
b == UNIT_ACTIVE ||
case JOB_START:
return
b == UNIT_ACTIVE ||
- b == UNIT_
ACTIVE_
RELOADING;
+ b == UNIT_RELOADING;
case JOB_STOP:
return
case JOB_STOP:
return
- b == UNIT_INACTIVE;
+ b == UNIT_INACTIVE ||
+ b == UNIT_MAINTENANCE;
case JOB_VERIFY_ACTIVE:
return
b == UNIT_ACTIVE ||
case JOB_VERIFY_ACTIVE:
return
b == UNIT_ACTIVE ||
- b == UNIT_
ACTIVE_
RELOADING;
+ b == UNIT_RELOADING;
case JOB_RELOAD:
return
case JOB_RELOAD:
return
- b == UNIT_
ACTIVE_
RELOADING;
+ b == UNIT_RELOADING;
case JOB_RELOAD_OR_START:
return
b == UNIT_ACTIVATING ||
case JOB_RELOAD_OR_START:
return
b == UNIT_ACTIVATING ||
- b == UNIT_
ACTIVE_
RELOADING;
+ b == UNIT_RELOADING;
case JOB_RESTART:
return
case JOB_RESTART:
return
@@
-415,7
+416,7
@@
int job_run_and_invalidate(Job *j) {
case JOB_RESTART: {
UnitActiveState t = unit_active_state(j->unit);
case JOB_RESTART: {
UnitActiveState t = unit_active_state(j->unit);
- if (t == UNIT_INACTIVE || t == UNIT_ACTIVATING) {
+ if (t == UNIT_INACTIVE || t == UNIT_
MAINTENANCE || t == UNIT_
ACTIVATING) {
j->type = JOB_START;
r = unit_start(j->unit);
} else
j->type = JOB_START;
r = unit_start(j->unit);
} else
@@
-425,7
+426,7
@@
int job_run_and_invalidate(Job *j) {
case JOB_TRY_RESTART: {
UnitActiveState t = unit_active_state(j->unit);
case JOB_TRY_RESTART: {
UnitActiveState t = unit_active_state(j->unit);
- if (t == UNIT_INACTIVE || t == UNIT_DEACTIVATING)
+ if (t == UNIT_INACTIVE || t == UNIT_
MAINTENANCE || t == UNIT_
DEACTIVATING)
r = -ENOEXEC;
else if (t == UNIT_ACTIVATING) {
j->type = JOB_START;
r = -ENOEXEC;
else if (t == UNIT_ACTIVATING) {
j->type = JOB_START;
@@
-476,6
+477,7
@@
int job_finish_and_invalidate(Job *j, bool success) {
return 0;
}
return 0;
}
+ j->failed = !success;
u = j->unit;
t = j->type;
job_free(j);
u = j->unit;
t = j->type;
job_free(j);