mirror of
https://github.com/systemd/systemd.git
synced 2026-08-02 22:20:20 +00:00
chase-symlinks: use empty_to_root() where appropriate
This commit is contained in:
@@ -177,7 +177,7 @@ int chase_symlinks(
|
||||
return r;
|
||||
}
|
||||
|
||||
fd = open(root ?: "/", O_CLOEXEC|O_DIRECTORY|O_PATH);
|
||||
fd = open(empty_to_root(root), O_CLOEXEC|O_DIRECTORY|O_PATH);
|
||||
if (fd < 0)
|
||||
return -errno;
|
||||
|
||||
@@ -321,7 +321,7 @@ int chase_symlinks(
|
||||
* directory as base. */
|
||||
|
||||
safe_close(fd);
|
||||
fd = open(root ?: "/", O_CLOEXEC|O_DIRECTORY|O_PATH);
|
||||
fd = open(empty_to_root(root), O_CLOEXEC|O_DIRECTORY|O_PATH);
|
||||
if (fd < 0)
|
||||
return -errno;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user