From 7b99c368158db2f622c1bb01de4bdde62270c2d0 Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Sun, 3 Jul 2011 17:31:12 +0200 Subject: Simplify 'shmdir' checks With XDG_RUNTIME_DIR, we no longer have to be frightened about NFS. That lets us remove the NFS checks that were causing build failures all over the place. --- common/dconf-shmdir.c | 51 +++++++-------------------------------------------- 1 file changed, 7 insertions(+), 44 deletions(-) diff --git a/common/dconf-shmdir.c b/common/dconf-shmdir.c index d87d6d7..cb40e11 100644 --- a/common/dconf-shmdir.c +++ b/common/dconf-shmdir.c @@ -21,41 +21,6 @@ #include "dconf-shmdir.h" -#ifndef __FreeBSD__ -#include -#include -#endif - -#include -#include -#include - -#ifndef NFS_SUPER_MAGIC -#define NFS_SUPER_MAGIC 0x6969 -#endif - -static gboolean -is_local (const gchar *filename) -{ - struct statfs buf; - gint s; - - do - s = statfs (filename, &buf); - while (s < 0 && errno == EINTR); - - if (s < 0 && errno == ENOENT) - { - g_mkdir_with_parents (filename, 0700); - - do - s = statfs (filename, &buf); - while (s < 0 && errno == EINTR); - } - - return s == 0 && buf.f_type != NFS_SUPER_MAGIC; -} - gchar * dconf_shmdir_from_environment (void) { @@ -65,19 +30,17 @@ dconf_shmdir_from_environment (void) if (result == NULL) { - const gchar *cache = g_get_user_cache_dir (); + result = g_build_filename (g_get_user_runtime_dir (), "dconf", NULL); - if (is_local (cache)) + if (g_mkdir_with_parents (result, 0700) != 0) { - result = g_build_filename (cache, "dconf", NULL); - - if (g_mkdir_with_parents (result, 0700) != 0) - { - g_free (result); - result = NULL; - } + g_free (result); + result = NULL; } } + + + return result; } -- cgit v1.2.1