mirror of
https://github.com/systemd/systemd
synced 2024-10-15 04:24:19 +00:00
shared/install: replace streq + basename with path_equal_filename
This commit is contained in:
parent
d51c404507
commit
3e02c8d87d
|
@ -1658,7 +1658,7 @@ static int install_info_follow(
|
||||||
|
|
||||||
/* If the basename doesn't match, the caller should add a complete new entry for this. */
|
/* If the basename doesn't match, the caller should add a complete new entry for this. */
|
||||||
|
|
||||||
if (!ignore_different_name && !streq(basename(info->symlink_target), info->name))
|
if (!ignore_different_name && !path_equal_filename(info->symlink_target, info->name))
|
||||||
return -EXDEV;
|
return -EXDEV;
|
||||||
|
|
||||||
free_and_replace(info->path, info->symlink_target);
|
free_and_replace(info->path, info->symlink_target);
|
||||||
|
@ -3115,7 +3115,7 @@ int unit_file_lookup_state(
|
||||||
|
|
||||||
case INSTALL_MODE_REGULAR:
|
case INSTALL_MODE_REGULAR:
|
||||||
/* Check if the name we were querying is actually an alias */
|
/* Check if the name we were querying is actually an alias */
|
||||||
if (!streq(name, basename(info->path)) && !unit_name_is_valid(info->name, UNIT_NAME_INSTANCE)) {
|
if (!path_equal_filename(name, info->path) && !unit_name_is_valid(info->name, UNIT_NAME_INSTANCE)) {
|
||||||
state = UNIT_FILE_ALIAS;
|
state = UNIT_FILE_ALIAS;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue