1
0
mirror of https://github.com/systemd/systemd synced 2025-09-28 16:24:45 +02:00

Compare commits

..

No commits in common. "e2ebc406ac78cb57612ce5c5d590018572d71df1" and "14f7d087ccc805c9c31d124164e47cf0118891ef" have entirely different histories.

3 changed files with 10 additions and 15 deletions

View File

@ -9,10 +9,8 @@ set -e
# so the files keep those permissions, otherwise details of what umask # so the files keep those permissions, otherwise details of what umask
# was set at the time the git tree was cloned will leak all the way # was set at the time the git tree was cloned will leak all the way
# through. Also set umask explicitly during the build. # through. Also set umask explicitly during the build.
if ! mountpoint -q "$SRCDIR"; then chmod -R u+w,go-w,a+rX .
chmod -R u+w,go-w,a+rX . umask 022
umask 022
fi
# If mkosi.builddir/ exists mkosi will set $BUILDDIR to it, let's then use it # If mkosi.builddir/ exists mkosi will set $BUILDDIR to it, let's then use it
# as out-of-tree build dir. Otherwise, let's make up our own builddir. # as out-of-tree build dir. Otherwise, let's make up our own builddir.

View File

@ -262,7 +262,7 @@ int unit_file_build_name_map(
* If yes, do nothing. */ * If yes, do nothing. */
if (cache_timestamp_hash && if (cache_timestamp_hash &&
lookup_paths_timestamp_hash_same(lp, *cache_timestamp_hash, &timestamp_hash)) lookup_paths_timestamp_hash_same(lp, *cache_timestamp_hash, &timestamp_hash))
return 0; return 0;
/* The timestamp hash is now set based on the mtimes from before when we start reading files. /* The timestamp hash is now set based on the mtimes from before when we start reading files.
* If anything is modified concurrently, we'll consider the cache outdated. */ * If anything is modified concurrently, we'll consider the cache outdated. */
@ -511,7 +511,7 @@ int unit_file_find_fragment(
r = unit_name_template(unit_name, &template); r = unit_name_template(unit_name, &template);
if (r < 0) if (r < 0)
return log_debug_errno(r, "Failed to determine template name: %m"); return log_error_errno(r, "Failed to determine template name: %m");
r = unit_ids_map_get(unit_ids_map, template, &fragment); r = unit_ids_map_get(unit_ids_map, template, &fragment);
if (r < 0 && !IN_SET(r, -ENOENT, -ENXIO)) if (r < 0 && !IN_SET(r, -ENOENT, -ENXIO))

View File

@ -439,15 +439,12 @@ int unit_find_paths(
/** /**
* Finds where the unit is defined on disk. Returns 0 if the unit is not found. Returns 1 if it is * Finds where the unit is defined on disk. Returns 0 if the unit is not found. Returns 1 if it is
* found, and sets: * found, and sets:
*
* - the path to the unit in *ret_frament_path, if it exists on disk, * - the path to the unit in *ret_frament_path, if it exists on disk,
*
* - and a strv of existing drop-ins in *ret_dropin_paths, if the arg is not NULL and any dropins * - and a strv of existing drop-ins in *ret_dropin_paths, if the arg is not NULL and any dropins
* were found. * were found.
* *
* Returns -ERFKILL if the unit is masked, and -EKEYREJECTED if the unit file could not be loaded for * Returns -ERFKILL if the unit is masked, and -EKEYREJECTED if the unit file could not be loaded for
* some reason (the latter only applies if we are going through the service manager). As special * some reason (the latter only applies if we are going through the service manager).
* exception it won't log for these two error cases.
*/ */
assert(unit_name); assert(unit_name);
@ -477,13 +474,13 @@ int unit_find_paths(
return log_error_errno(r, "Failed to get LoadState: %s", bus_error_message(&error, r)); return log_error_errno(r, "Failed to get LoadState: %s", bus_error_message(&error, r));
if (streq(load_state, "masked")) if (streq(load_state, "masked"))
return -ERFKILL; /* special case: no logging */ return -ERFKILL;
if (streq(load_state, "not-found")) { if (streq(load_state, "not-found")) {
r = 0; r = 0;
goto finish; goto not_found;
} }
if (!STR_IN_SET(load_state, "loaded", "bad-setting")) if (!STR_IN_SET(load_state, "loaded", "bad-setting"))
return -EKEYREJECTED; /* special case: no logging */ return -EKEYREJECTED;
r = sd_bus_get_property_string( r = sd_bus_get_property_string(
bus, bus,
@ -520,7 +517,7 @@ int unit_find_paths(
r = unit_file_find_fragment(*cached_id_map, *cached_name_map, unit_name, &_path, &names); r = unit_file_find_fragment(*cached_id_map, *cached_name_map, unit_name, &_path, &names);
if (r < 0) if (r < 0)
return log_error_errno(r, "Failed to find fragment for '%s': %m", unit_name); return r;
if (_path) { if (_path) {
path = strdup(_path); path = strdup(_path);
@ -537,7 +534,6 @@ int unit_find_paths(
} }
} }
finish:
if (isempty(path)) { if (isempty(path)) {
*ret_fragment_path = NULL; *ret_fragment_path = NULL;
r = 0; r = 0;
@ -554,6 +550,7 @@ int unit_find_paths(
*ret_dropin_paths = NULL; *ret_dropin_paths = NULL;
} }
not_found:
if (r == 0 && !arg_force) if (r == 0 && !arg_force)
log_error("No files found for %s.", unit_name); log_error("No files found for %s.", unit_name);