tree-wide: port things over to FORMAT_PROC_FD_PATH()

This commit is contained in:
Lennart Poettering
2021-08-19 09:19:27 +02:00
parent 48a01cd934
commit ddb6eeafe2
15 changed files with 52 additions and 122 deletions
+1 -5
View File
@@ -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;
}