Skip to content
Snippets Groups Projects
Commit a6d08657 authored by Yu Qi Zhang's avatar Yu Qi Zhang Committed by Colin Walters
Browse files

fdio: Delete .tmp file on failure

We noticed the temp files being left over in ostree when (mistakenly)
trying to replace the contents of a subpath that wasn't a directory.

In the future we should look at the systemd code using `O_TMPFILE`
here.
parent afe3c3a8
No related branches found
No related tags found
No related merge requests found
...@@ -746,6 +746,8 @@ glnx_file_replace_contents_with_perms_at (int dfd, ...@@ -746,6 +746,8 @@ glnx_file_replace_contents_with_perms_at (int dfd,
ret = TRUE; ret = TRUE;
out: out:
if (!ret)
(void) unlink (tmppath);
return ret; return ret;
} }
......
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