tree-wide: Use helpers for unlinkat()

We have `ot_ensure_unlinked_at()` for the "ignore ENOENT" case, and
`glnx_unlinkat()` otherwise. Port all in-tree callers to one or the other as
appropriate.

Just noticed an unprefixed error in the refs case and decided to do a tree-wide
check.

Closes: #1142
Approved by: jlebon
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2017-09-07 16:45:48 +00:00
1 parent 57509e4d50
commit 303320163f
6 files changed
+16 -36

No files matched your search

+2 -5
View File
@@ -1007,11 +1007,8 @@ _ostree_repo_write_ref (OstreeRepo *self,
{
if (dfd >= 0)
{
if (unlinkat (dfd, ref->ref_name, 0) != 0)
{
if (errno != ENOENT)
return glnx_throw_errno (error);
}
if (!ot_ensure_unlinked_at (dfd, ref->ref_name, error))
return FALSE;
}
}
else if (rev != NULL)