sysroot: Add some error prefixing for bootversion
authorColin Walters <walters@verbum.org>
Wed, 12 Jul 2023 23:29:20 +0000 (19:29 -0400)
committerColin Walters <walters@verbum.org>
Wed, 12 Jul 2023 23:29:20 +0000 (19:29 -0400)
This came up in https://issues.redhat.com/browse/OCPBUGS-15955
and I'm 90% sure it's this readlink failing, but let's make
it extra clear.

src/libostree/ostree-sysroot.c

index 946bd35359b7f6a73c2fccfc8e423171c9909418..d786cc5a2aa96d161424267746616e07c98f2a3b 100644 (file)
@@ -537,6 +537,8 @@ _ostree_sysroot_read_current_subbootversion (OstreeSysroot *self, int bootversio
                                              int *out_subbootversion, GCancellable *cancellable,
                                              GError **error)
 {
+  GLNX_AUTO_PREFIX_ERROR ("Reading current subbootversion", error);
+
   if (!ensure_sysroot_fd (self, error))
     return FALSE;
 
@@ -556,7 +558,7 @@ _ostree_sysroot_read_current_subbootversion (OstreeSysroot *self, int bootversio
       g_autofree char *current_subbootdir_name
           = glnx_readlinkat_malloc (self->sysroot_fd, ostree_bootdir_name, cancellable, error);
       if (!current_subbootdir_name)
-        return FALSE;
+        return glnx_prefix_error (error, "Reading %s", ostree_bootdir_name);
 
       if (g_str_has_suffix (current_subbootdir_name, ".0"))
         *out_subbootversion = 0;