summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2011-07-03 17:31:12 +0200
committerRyan Lortie <desrt@desrt.ca>2011-07-03 17:31:12 +0200
commit7b99c368158db2f622c1bb01de4bdde62270c2d0 (patch)
tree35b300149fcc691170e1d79dbcda4344bdc90198
parenta15d9621fc7019b01968df737da4f2d3772d3fb2 (diff)
downloaddconf-7b99c368158db2f622c1bb01de4bdde62270c2d0.tar.gz
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.
-rw-r--r--common/dconf-shmdir.c51
1 files 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 <sys/statfs.h>
-#include <sys/vfs.h>
-#endif
-
-#include <sys/param.h>
-#include <sys/mount.h>
-#include <errno.h>
-
-#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;
}