]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
unit-file,portable: replace streq + basename with path_equal_filename 32603/head
authorMike Yuan <me@yhndnzj.com>
Wed, 1 May 2024 09:09:52 +0000 (17:09 +0800)
committerLuca Boccassi <bluca@debian.org>
Tue, 11 Jun 2024 22:17:21 +0000 (23:17 +0100)
src/basic/unit-file.c
src/portable/portabled-image-bus.c

index 54f2137a3662fa12940686daf808c1e2d1a22791..ca2686b2099576dfdce94978c5ee5fb1d659ba28 100644 (file)
@@ -699,7 +699,7 @@ static int add_names(
 
                         if (inst_fragment &&
                             fragment_basename &&
-                            !streq(basename(inst_fragment), fragment_basename)) {
+                            !path_equal_filename(inst_fragment, fragment_basename)) {
                                 log_debug("Instance %s has fragment %s and is not an alias of %s.",
                                           inst, inst_fragment, unit_name);
                                 continue;
index 8db55742425aee5402a096a98f072e745ea1c9a6..0ca04d3a0b9b101b81908b9d6474f07c5844e523 100644 (file)
@@ -596,7 +596,7 @@ static int normalize_portable_changes(
                 bool found = false;
 
                 for (size_t j = 0; j < n_changes_attached; ++j)
-                        if (streq(basename(changes_detached[i].path), basename(changes_attached[j].path))) {
+                        if (path_equal_filename(changes_detached[i].path, changes_attached[j].path)) {
                                 found = true;
                                 break;
                         }