diff options
author | Ryan Lortie <desrt@desrt.ca> | 2010-07-17 12:42:44 -0400 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2010-07-17 12:42:44 -0400 |
commit | d03bd6b443a6b98430eed983cb1996bebb302d9e (patch) | |
tree | ad040268acec58c8bd123931bffa17158d259157 /common | |
parent | bece1f7488e07c2d3f2c9b978ef0065a3ab1413f (diff) | |
download | dconf-d03bd6b443a6b98430eed983cb1996bebb302d9e.tar.gz |
on NFS create a temp dir for the shm file
dconf should be vaguely NFS-safe now
Diffstat (limited to 'common')
-rw-r--r-- | common/dconf-shmdir.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/common/dconf-shmdir.c b/common/dconf-shmdir.c index d94f5c3..4eaa376 100644 --- a/common/dconf-shmdir.c +++ b/common/dconf-shmdir.c @@ -1,4 +1,5 @@ #include "dconf-shmdir.h" + #include <sys/statfs.h> #include <sys/vfs.h> #include <errno.h> @@ -41,13 +42,15 @@ dconf_shmdir_from_environment (void) const gchar *cache = g_get_user_cache_dir (); if (is_local (cache)) - result = g_build_filename (cache, "dconf", NULL); - } - - if (g_mkdir_with_parents (result, 0700)) - { - g_free (result); - result = NULL; + { + result = g_build_filename (cache, "dconf", NULL); + + if (g_mkdir_with_parents (result, 0700) != 0) + { + g_free (result); + result = NULL; + } + } } return result; |