Skip to content
Snippets Groups Projects
Commit 78ae7877 authored by Colin Walters's avatar Colin Walters
Browse files

fdio: Use correct dfd with O_TMPFILE in rename case

While auditing this code to figure out why ostree's
`tests/test-refs.sh` was failing, while the bug turned out to be
different, I noticed that in the case where `dfd != target_dfd`, we
failed to do the right `renameat()`.  (No code I'm aware of does this
now).
parent 113c770d
No related branches found
No related tags found
No related merge requests found
......@@ -255,7 +255,7 @@ glnx_link_tmpfile_at (int dfd,
g_set_error (error, G_IO_ERROR, G_IO_ERROR_EXISTS,
"Exhausted %u attempts to create temporary file", count);
}
if (renameat (dfd, tmpname_buf, target_dfd, target) < 0)
if (renameat (target_dfd, tmpname_buf, target_dfd, target) < 0)
{
glnx_set_error_from_errno (error);
return FALSE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment