diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-08-18 09:43:25 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-08-19 09:19:27 +0200 |
commit | ddb6eeafe2d3445eeab2c450cf9d270d68b3a4b7 (patch) | |
tree | 4ff19b6603b181e4e6f8c1181fbbc7256937479d /src/basic/tmpfile-util.c | |
parent | 48a01cd93483d93de6f58431bb316dcedc55f3d3 (diff) | |
download | systemd-ddb6eeafe2d3445eeab2c450cf9d270d68b3a4b7.tar.gz |
tree-wide: port things over to FORMAT_PROC_FD_PATH()
Diffstat (limited to 'src/basic/tmpfile-util.c')
-rw-r--r-- | src/basic/tmpfile-util.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/basic/tmpfile-util.c b/src/basic/tmpfile-util.c index 91c8ff1725..36930cb34b 100644 --- a/src/basic/tmpfile-util.c +++ b/src/basic/tmpfile-util.c @@ -300,11 +300,7 @@ int link_tmpfile(int fd, const char *path, const char *target) { if (r < 0) return r; } else { - char proc_fd_path[STRLEN("/proc/self/fd/") + DECIMAL_STR_MAX(fd) + 1]; - - xsprintf(proc_fd_path, "/proc/self/fd/%i", fd); - - if (linkat(AT_FDCWD, proc_fd_path, AT_FDCWD, target, AT_SYMLINK_FOLLOW) < 0) + if (linkat(AT_FDCWD, FORMAT_PROC_FD_PATH(fd), AT_FDCWD, target, AT_SYMLINK_FOLLOW) < 0) return -errno; } |