mirror of
https://github.com/systemd/systemd.git
synced 2025-02-02 13:47:27 +03:00
tree-wide: fd_get_path() already understands AT_FDCWD natively
This commit is contained in:
parent
92acb89735
commit
e82677aa07
@ -351,12 +351,8 @@ static int image_make(
|
||||
st = &stbuf;
|
||||
}
|
||||
|
||||
if (!path) {
|
||||
if (dfd == AT_FDCWD)
|
||||
(void) safe_getcwd(&parent);
|
||||
else
|
||||
(void) fd_get_path(dfd, &parent);
|
||||
}
|
||||
if (!path)
|
||||
(void) fd_get_path(dfd, &parent);
|
||||
|
||||
read_only =
|
||||
(path && path_startswith(path, "/usr")) ||
|
||||
|
@ -584,10 +584,7 @@ int mac_selinux_create_file_prepare_at(
|
||||
return 0;
|
||||
|
||||
if (isempty(path) || !path_is_absolute(path)) {
|
||||
if (dir_fd == AT_FDCWD)
|
||||
r = safe_getcwd(&abspath);
|
||||
else
|
||||
r = fd_get_path(dir_fd, &abspath);
|
||||
r = fd_get_path(dir_fd, &abspath);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user