From 7cb7f8b8e430b6b9d3a6d8617d01703be0944701 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 26 Feb 2025 17:57:19 +0100 Subject: [PATCH] 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. --- src/core/unit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/unit.c b/src/core/unit.c index 476c5332da9..21d57f73bcd 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -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; -- 2.47.3