From 7748c361ef1ca2aaca1e20316b60f28a94821a32 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 30 May 2016 11:20:18 -0400 Subject: [PATCH] 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 --- src/libostree/ostree-sysroot.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libostree/ostree-sysroot.c b/src/libostree/ostree-sysroot.c index bc8dde66..8949f8f5 100644 --- a/src/libostree/ostree-sysroot.c +++ b/src/libostree/ostree-sysroot.c @@ -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);