1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-28 02:50:16 +03:00

tmpfiles: use prefix_roota() where appropriate

This commit is contained in:
Mike Yuan 2025-02-09 15:38:40 +01:00
parent 6f91e7a3be
commit 7b66a950db
No known key found for this signature in database
GPG Key ID: 417471C0A40F58B3

View File

@ -2408,14 +2408,14 @@ static int create_symlink(Context *c, Item *i) {
assert(i);
if (i->ignore_if_target_missing) {
r = chase(i->argument, arg_root, CHASE_SAFE|CHASE_PREFIX_ROOT|CHASE_NOFOLLOW, /*ret_path=*/ NULL, /*ret_fd=*/ NULL);
r = chase(i->argument, arg_root, CHASE_SAFE|CHASE_PREFIX_ROOT|CHASE_NOFOLLOW, /* ret_path = */ NULL, /* ret_fd = */ NULL);
if (r == -ENOENT) {
/* Silently skip over lines where the source file is missing. */
log_info("Symlink source path '%s%s' does not exist, skipping line.", strempty(arg_root), i->argument);
log_info("Symlink source path '%s' does not exist, skipping line.", prefix_roota(arg_root, i->argument));
return 0;
}
if (r < 0)
return log_error_errno(r, "Failed to check if symlink source path '%s%s' exists: %m", strempty(arg_root), i->argument);
return log_error_errno(r, "Failed to check if symlink source path '%s' exists: %m", prefix_roota(arg_root, i->argument));
}
r = path_extract_filename(i->path, &bn);