]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/analyze/analyze-verify.c
tree-wide: drop license boilerplate
[thirdparty/systemd.git] / src / analyze / analyze-verify.c
index 0ce0276d92d4a25d7a63472982f7fe91ec2c3f75..fdaf90c7fc0a6d13498c3d61cd25f7078a2f9e55 100644 (file)
@@ -1,20 +1,8 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
   Copyright 2014 Zbigniew JÄ™drzejewski-Szmek
-
-  systemd is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as published by
-  the Free Software Foundation; either version 2.1 of the License, or
-  (at your option) any later version.
-
-  systemd is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public License
-  along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
 #include <stdlib.h>
@@ -146,7 +134,7 @@ static int verify_socket(Unit *u) {
 }
 
 static int verify_executable(Unit *u, ExecCommand *exec) {
-        if (exec == NULL)
+        if (!exec)
                 return 0;
 
         if (access(exec->path, X_OK) < 0)
@@ -219,7 +207,7 @@ static int verify_unit(Unit *u, bool check_man) {
 
         assert(u);
 
-        if (log_get_max_level() >= LOG_DEBUG)
+        if (DEBUG_LOGGING)
                 unit_dump(u, stdout, "\t");
 
         log_unit_debug(u, "Creating %s/start job", u->id);
@@ -242,7 +230,7 @@ static int verify_unit(Unit *u, bool check_man) {
         return r;
 }
 
-int verify_units(char **filenames, UnitFileScope scope, bool check_man) {
+int verify_units(char **filenames, UnitFileScope scope, bool check_man, bool run_generators) {
         _cleanup_(sd_bus_error_free) sd_bus_error err = SD_BUS_ERROR_NULL;
         _cleanup_free_ char *var = NULL;
         Manager *m = NULL;
@@ -253,6 +241,9 @@ int verify_units(char **filenames, UnitFileScope scope, bool check_man) {
 
         Unit *units[strv_length(filenames)];
         int i, count = 0;
+        const uint8_t flags = MANAGER_TEST_RUN_BASIC |
+                              MANAGER_TEST_RUN_ENV_GENERATORS |
+                              run_generators * MANAGER_TEST_RUN_GENERATORS;
 
         if (strv_isempty(filenames))
                 return 0;
@@ -264,7 +255,7 @@ int verify_units(char **filenames, UnitFileScope scope, bool check_man) {
 
         assert_se(set_unit_path(var) >= 0);
 
-        r = manager_new(scope, true, &m);
+        r = manager_new(scope, flags, &m);
         if (r < 0)
                 return log_error_errno(r, "Failed to initialize manager: %m");