Skip to content

Commit 7cb7f8b

Browse files
committed
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.
1 parent e735bc4 commit 7cb7f8b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core/unit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Unit* unit_new(Manager *m, size_t size) {
107107
u->type = _UNIT_TYPE_INVALID;
108108
u->default_dependencies = true;
109109
u->unit_file_state = _UNIT_FILE_STATE_INVALID;
110-
u->unit_file_preset = -1;
110+
u->unit_file_preset = _PRESET_ACTION_INVALID;
111111
u->on_failure_job_mode = JOB_REPLACE;
112112
u->on_success_job_mode = JOB_FAIL;
113113
u->job_timeout = USEC_INFINITY;

0 commit comments

Comments
 (0)