summaryrefslogtreecommitdiff
path: root/src/basic/tmpfile-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-08-18 09:43:25 +0200
committerLennart Poettering <lennart@poettering.net>2021-08-19 09:19:27 +0200
commitddb6eeafe2d3445eeab2c450cf9d270d68b3a4b7 (patch)
tree4ff19b6603b181e4e6f8c1181fbbc7256937479d /src/basic/tmpfile-util.c
parent48a01cd93483d93de6f58431bb316dcedc55f3d3 (diff)
downloadsystemd-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.c6
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;
}