service: don't second guess invocation mode again

let's just check the debug invocation boolean, and not recheck the
restart mode again. It's mostly redundant (because the boolean should
not have been become true if the restart mode was not set accordingly).

Moreover, i think we might want to eventually allow a manual way to
enable debug invocation mode, and hence this pointless checking would
become a problem.

Also, we never check the restart mode again in other cases, hence we
shouldn't here either.
This commit is contained in:
Lennart Poettering
2024-11-27 10:19:35 +01:00
committed by Yu Watanabe
parent d79ba8574b
commit fbb159b789

View File

@@ -1879,7 +1879,7 @@ static int service_spawn_internal(
}
}
if (s->restart_mode == SERVICE_RESTART_MODE_DEBUG && UNIT(s)->debug_invocation) {
if (UNIT(s)->debug_invocation) {
char *t = strdup("DEBUG_INVOCATION=1");
if (!t)
return -ENOMEM;