Blame SOURCES/0002-postprocess-use-glnx_throw-helpers-to-add-details.patch

c034ea
From 4a5e9c3086da507f7be9bdf84b17aaaca4d18ad7 Mon Sep 17 00:00:00 2001
c034ea
From: Jonathan Lebon <jlebon@redhat.com>
c034ea
Date: Thu, 15 Jun 2017 13:20:34 -0400
c034ea
Subject: [PATCH 2/4] postprocess: use glnx_throw helpers to add details
c034ea
c034ea
Closes: #831
c034ea
Approved by: cgwalters
c034ea
---
c034ea
 src/libpriv/rpmostree-postprocess.c | 20 ++++----------------
c034ea
 1 file changed, 4 insertions(+), 16 deletions(-)
c034ea
c034ea
diff --git a/src/libpriv/rpmostree-postprocess.c b/src/libpriv/rpmostree-postprocess.c
c034ea
index db24c70..77ad66a 100644
c034ea
--- a/src/libpriv/rpmostree-postprocess.c
c034ea
+++ b/src/libpriv/rpmostree-postprocess.c
c034ea
@@ -595,10 +595,7 @@ postprocess_selinux_policy_store_location (int rootfs_dfd,
c034ea
   if (fstatat (rootfs_dfd, var_policy_location, &stbuf, 0) != 0)
c034ea
     {
c034ea
       if (errno != ENOENT)
c034ea
-        {
c034ea
-          glnx_set_error_from_errno (error);
c034ea
-          return FALSE;
c034ea
-        }
c034ea
+        return glnx_throw_errno_prefix (error, "fstat(%s)", modules_location);
c034ea
 
c034ea
       /* Okay, this is probably CentOS 7, or maybe we have a build of
c034ea
        * selinux-policy with the path moved back into /etc (or maybe it's
c034ea
@@ -615,28 +612,19 @@ postprocess_selinux_policy_store_location (int rootfs_dfd,
c034ea
     orig_contents = glnx_file_get_contents_utf8_at (rootfs_dfd, semanage_path, NULL,
c034ea
                                                     cancellable, error);
c034ea
     if (orig_contents == NULL)
c034ea
-      {
c034ea
-        g_prefix_error (error, "Opening %s: ", semanage_path);
c034ea
-        return FALSE;
c034ea
-      }
c034ea
+      return glnx_prefix_error (error, "Opening %s:", semanage_path);
c034ea
 
c034ea
     contents = g_strconcat (orig_contents, "\nstore-root=/etc/selinux\n", NULL);
c034ea
 
c034ea
     if (!glnx_file_replace_contents_at (rootfs_dfd, semanage_path,
c034ea
                                         (guint8*)contents, -1, 0,
c034ea
                                         cancellable, error))
c034ea
-      {
c034ea
-        g_prefix_error (error, "Replacing %s: ", semanage_path);
c034ea
-        return FALSE;
c034ea
-      }
c034ea
+      return glnx_prefix_error (error, "Replacing %s:", semanage_path);
c034ea
   }
c034ea
 
c034ea
   etc_policy_location = glnx_strjoina ("etc/selinux/", name);
c034ea
   if (!glnx_opendirat (rootfs_dfd, etc_policy_location, TRUE, &etc_selinux_dfd, error))
c034ea
-    {
c034ea
-      g_prefix_error (error, "Opening %s: ", etc_policy_location);
c034ea
-      return FALSE;
c034ea
-    }
c034ea
+    return glnx_prefix_error (error, "Opening %s:", etc_policy_location);
c034ea
 
c034ea
   if (!glnx_dirfd_iterator_init_at (rootfs_dfd, var_policy_location, TRUE, &dfd_iter, error))
c034ea
     return FALSE;
c034ea
-- 
c034ea
2.13.0
c034ea