io/FileOutputStream: pass dfd=-1 for absolute /proc/self/fd/N path

This commit is contained in:
Max Kellermann 2023-10-04 15:26:41 +02:00
parent 86e7dff2fc
commit b9704715fb
1 changed files with 1 additions and 1 deletions

View File

@ -281,7 +281,7 @@ try {
unlinkat(directory_fd.Get(), GetPath().c_str(), 0);
/* hard-link the temporary file to the final path */
if (linkat(AT_FDCWD,
if (linkat(-1,
FmtBuffer<64>("/proc/self/fd/{}", fd.Get()),
directory_fd.Get(), path.c_str(),
AT_SYMLINK_FOLLOW) < 0)