summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2010-07-17 12:42:44 -0400
committerRyan Lortie <desrt@desrt.ca>2010-07-17 12:42:44 -0400
commitd03bd6b443a6b98430eed983cb1996bebb302d9e (patch)
treead040268acec58c8bd123931bffa17158d259157 /common
parentbece1f7488e07c2d3f2c9b978ef0065a3ab1413f (diff)
downloaddconf-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.c17
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;