chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dbus: complete coverage of manager interface
[elogind.git]
/
src
/
job.c
diff --git
a/src/job.c
b/src/job.c
index 887de92cadf88eb70033ff665e6be829b421b513..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;
@@
-144,11
+144,12
@@
void job_dependency_delete(Job *subject, Job *object, bool *matters) {
}
void job_dump(Job *j, FILE*f, const char *prefix) {
}
void job_dump(Job *j, FILE*f, const char *prefix) {
-
-
assert(j);
assert(f);
assert(j);
assert(f);
+ if (!prefix)
+ prefix = "";
+
fprintf(f,
"%s-> Job %u:\n"
"%s\tAction: %s -> %s\n"
fprintf(f,
"%s-> Job %u:\n"
"%s\tAction: %s -> %s\n"
@@
-274,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
@@
-414,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
@@
-424,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;
@@
-475,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);