[gnome-desktop/wip/hadess/sandbox-flatpak-thumbnailer: 3/6] thumbnail: Namespace bwrap helper function




commit 4ed213c96601b203e41d27a5b39e50ef996ddc19
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Oct 9 10:40:56 2020 +0200

    thumbnail: Namespace bwrap helper function

 libgnome-desktop/gnome-desktop-thumbnail-script.c | 24 +++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/libgnome-desktop/gnome-desktop-thumbnail-script.c 
b/libgnome-desktop/gnome-desktop-thumbnail-script.c
index 95741301..387e5638 100644
--- a/libgnome-desktop/gnome-desktop-thumbnail-script.c
+++ b/libgnome-desktop/gnome-desktop-thumbnail-script.c
@@ -136,16 +136,6 @@ add_args (GPtrArray *argv_array, ...)
   va_end (args);
 }
 
-static void
-add_env (GPtrArray  *array,
-         const char *envvar)
-{
-  if (g_getenv (envvar) != NULL)
-    add_args (array,
-              "--setenv", envvar, g_getenv (envvar),
-              NULL);
-}
-
 #ifdef ENABLE_SECCOMP
 static gboolean
 flatpak_fail (GError     **error,
@@ -524,6 +514,16 @@ path_is_usrmerged (const char *dir)
          (stat_buf_src.st_ino == stat_buf_target.st_ino);
 }
 
+static void
+add_bwrap_env (GPtrArray  *array,
+               const char *envvar)
+{
+  if (g_getenv (envvar) != NULL)
+    add_args (array,
+              "--setenv", envvar, g_getenv (envvar),
+              NULL);
+}
+
 static gboolean
 add_bwrap (GPtrArray   *array,
           ScriptExec  *script)
@@ -589,8 +589,8 @@ add_bwrap (GPtrArray   *array,
            "--die-with-parent",
            NULL);
 
-  add_env (array, "G_MESSAGES_DEBUG");
-  add_env (array, "G_MESSAGES_PREFIXED");
+  add_bwrap_env (array, "G_MESSAGES_DEBUG");
+  add_bwrap_env (array, "G_MESSAGES_PREFIXED");
 
   /* Add gnome-desktop's install prefix if needed */
   if (g_strcmp0 (INSTALL_PREFIX, "") != 0 &&


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]