summaryrefslogtreecommitdiff
path: root/src/libostree/ostree-fetcher-curl.c
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2017-06-24 14:06:53 +0000
committerAtomic Bot <atomic-devel@projectatomic.io>2017-06-27 22:02:14 +0000
commit5776d5dcc09e5aabae1b5c1b8854c0b66522accd (patch)
tree466c0a17f2c0378d4ff938078718dc17c0d50396 /src/libostree/ostree-fetcher-curl.c
parent79f285d188eef288cecb35ed7977bf6e219cc396 (diff)
downloadostree-5776d5dcc09e5aabae1b5c1b8854c0b66522accd.tar.gz
Port to GLnxTmpfile
There's lots of mechanically replacing `OtTmpFile` with `GLnxTmpfile`; the biggest changes are in the commit path. Symlink commits are now very clearly separated from regular files. Symlinks are `OtCleanupUnlinkat`, and regular files are `GLnxTmpfile`. The commit codepath separates those as `_ostree_repo_commit_path_final()` and `_ostree_repo_commit_tmpf_final()`. A nice aspect of all of this is that they both *consume* the temporary on success. This avoids an extra spurious `unlink()` call. One of the biggest bits of code motion is in `commit_loose_regfile_object()`, which no longer needs to care about symlinks. For the most parth though it's just removing conditionals. Update submodule: libglnx Closes: #958 Approved by: jlebon
Diffstat (limited to 'src/libostree/ostree-fetcher-curl.c')
-rw-r--r--src/libostree/ostree-fetcher-curl.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libostree/ostree-fetcher-curl.c b/src/libostree/ostree-fetcher-curl.c
index f483a6bb..5d35e7b7 100644
--- a/src/libostree/ostree-fetcher-curl.c
+++ b/src/libostree/ostree-fetcher-curl.c
@@ -99,7 +99,7 @@ struct FetcherRequest {
OstreeFetcherRequestFlags flags;
gboolean is_membuf;
GError *caught_write_error;
- OtTmpfile tmpf;
+ GLnxTmpfile tmpf;
GString *output_buf;
CURL *easy;
@@ -270,9 +270,9 @@ ensure_tmpfile (FetcherRequest *req, GError **error)
{
if (!req->tmpf.initialized)
{
- if (!ot_open_tmpfile_linkable_at (req->fetcher->tmpdir_dfd, ".",
- O_WRONLY | O_CLOEXEC, &req->tmpf,
- error))
+ if (!glnx_open_tmpfile_linkable_at (req->fetcher->tmpdir_dfd, ".",
+ O_WRONLY | O_CLOEXEC, &req->tmpf,
+ error))
return FALSE;
}
return TRUE;
@@ -390,9 +390,9 @@ check_multi_info (OstreeFetcher *fetcher)
glnx_set_error_from_errno (error);
g_task_return_error (task, g_steal_pointer (&local_error));
}
- else if (!ot_link_tmpfile_at (&req->tmpf, GLNX_LINK_TMPFILE_REPLACE,
- fetcher->tmpdir_dfd, tmpfile_path,
- error))
+ else if (!glnx_link_tmpfile_at (&req->tmpf, GLNX_LINK_TMPFILE_REPLACE,
+ fetcher->tmpdir_dfd, tmpfile_path,
+ error))
g_task_return_error (task, g_steal_pointer (&local_error));
else
{
@@ -616,7 +616,7 @@ request_unref (FetcherRequest *req)
g_ptr_array_unref (req->mirrorlist);
g_free (req->filename);
g_clear_error (&req->caught_write_error);
- ot_tmpfile_clear (&req->tmpf);
+ glnx_tmpfile_clear (&req->tmpf);
if (req->output_buf)
g_string_free (req->output_buf, TRUE);
curl_easy_cleanup (req->easy);