[glib/portal] portal support: Use g_get_user_runtime_dir()



commit 162fe9a1693dbad55747bcea7a5b79bcedbd096b
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Jun 30 11:40:39 2016 -0400

    portal support: Use g_get_user_runtime_dir()
    
    Pointed out by Cosimo Cecchi and Mario Sanchez Prada.

 gio/gportalsupport.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gio/gportalsupport.c b/gio/gportalsupport.c
index a14acd9..635daa3 100644
--- a/gio/gportalsupport.c
+++ b/gio/gportalsupport.c
@@ -28,7 +28,7 @@ glib_should_use_portal (void)
   const char *use_portal;
   char *path;
 
-  path = g_strdup_printf ("/run/user/%d/flatpak-info", getuid());
+  path = g_strdup_printf ("%s/flatpak-info", g_get_user_runtime_dir ());
   if (g_file_test (path, G_FILE_TEST_EXISTS))
     use_portal = "1";
   else
@@ -49,7 +49,7 @@ glib_network_available_in_sandbox (void)
   GKeyFile *keyfile;
   gboolean available = TRUE;
 
-  path = g_strdup_printf ("/run/user/%d/flatpak-info", getuid());
+  path = g_strdup_printf ("%s/flatpak-info", g_get_user_runtime_dir ());
 
   keyfile = g_key_file_new ();
   if (g_key_file_load_from_file (keyfile, path, G_KEY_FILE_NONE, NULL))


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