]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
service: don't second guess invocation mode again
authorLennart Poettering <lennart@poettering.net>
Wed, 27 Nov 2024 09:19:35 +0000 (10:19 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 27 Nov 2024 15:14:55 +0000 (00:14 +0900)
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.

src/core/service.c

index 34d40c69508b7441e57aa6adfda13dfe1fd7ea1c..f4919bb2b1b01355122ee3bd26554c492a2fe140 100644 (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;