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
@@ -1121,11 +1121,8 @@ ostree_repo_checkout_gc (OstreeRepo *self,
if (stbuf.st_nlink == 1)
{
if (unlinkat (dfd_iter.fd, dent->d_name, 0) != 0)
{
glnx_set_error_from_errno (error);
return FALSE;
}
if (!glnx_unlinkat (dfd_iter.fd, dent->d_name, 0, error))
return FALSE;
}
}
}