job: properly initialize all enum fields
This changes the .result field to invalid initially, which arguably makes more sense than "done", which was previously the default. This is a correctnes fix, and afaics has no effect on the API, since we do not expose this 1:1 as D-Bus property: it's only seen on D-Bus as part of the job completion signal, at which part it is correctly initialized. Noticed while reviewing: https://github.com/systemd/systemd/pull/41583
This commit is contained in:
committed by
Luca Boccassi
parent
59e78701ec
commit
143126cbcd
@@ -41,6 +41,8 @@ Job* job_new_raw(Unit *unit) {
|
||||
.manager = unit->manager,
|
||||
.unit = unit,
|
||||
.type = _JOB_TYPE_INVALID,
|
||||
.state = JOB_WAITING,
|
||||
.result = _JOB_RESULT_INVALID,
|
||||
};
|
||||
|
||||
return j;
|
||||
|
||||
@@ -106,7 +106,6 @@ typedef struct Job {
|
||||
|
||||
JobType type;
|
||||
JobState state;
|
||||
|
||||
JobResult result;
|
||||
|
||||
unsigned run_queue_idx;
|
||||
|
||||
Reference in New Issue
Block a user