sysroot: Correct error handling path in previous libglnx port

I happened to have the github page open with my commit after it was
merged, and then noticed a bug.

We still need to throw if we hit a non-`ENOENT` error.

Closes: #315
Approved by: giuseppe
This commit is contained in:
Colin Walters 2016-05-30 11:20:18 -04:00 committed by Atomic Bot
parent 6e57987c7c
commit 7748c361ef

View File

@ -293,7 +293,12 @@ ostree_sysroot_ensure_initialized (OstreeSysroot *self,
if (fstatat (self->sysroot_fd, "ostree/repo/objects", &stbuf, 0) != 0)
{
if (errno == ENOENT)
if (errno != ENOENT)
{
glnx_set_prefix_error_from_errno (error, "stat %s", "ostree/repo/objects");
goto out;
}
else
{
g_autoptr(GFile) repo_dir = g_file_resolve_relative_path (self->path, "ostree/repo");
glnx_unref_object OstreeRepo *repo = ostree_repo_new (repo_dir);