1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-31 14:50:15 +03:00

unit: initialize unit_file_preset field to valid value

"-1" is not a valid enum value. Use a better one. All code using this
considers negative values error codes anyway, hence the old code was
just a weird way to write -EPERM. Let's clean this up.
This commit is contained in:
Lennart Poettering 2025-02-26 17:57:19 +01:00
parent 27bd1f10bb
commit 562b01500d

View File

@ -107,7 +107,7 @@ Unit* unit_new(Manager *m, size_t size) {
u->type = _UNIT_TYPE_INVALID;
u->default_dependencies = true;
u->unit_file_state = _UNIT_FILE_STATE_INVALID;
u->unit_file_preset = -1;
u->unit_file_preset = _PRESET_ACTION_INVALID;
u->on_failure_job_mode = JOB_REPLACE;
u->on_success_job_mode = JOB_FAIL;
u->job_timeout = USEC_INFINITY;