diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-06-28 19:35:34 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-06-28 19:35:34 +0200 |
commit | 47b571d306a3da9932bc2616ab954ee342ec6519 (patch) | |
tree | bba5fc766ac151b570a182469f7146ee8863e08f /storage_xml.c | |
parent | 178e2f8f71e5ebd4501f455c874f816b9ba19ade (diff) |
Avoid g_access on GLib < 2.8.0.
Diffstat (limited to 'storage_xml.c')
-rw-r--r-- | storage_xml.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/storage_xml.c b/storage_xml.c index ca82a9d1..cb92135c 100644 --- a/storage_xml.c +++ b/storage_xml.c @@ -30,6 +30,11 @@ #include "md5.h" #include <glib/gstdio.h> +#if !GLIB_CHECK_VERSION(2,8,0) +/* GLib < 2.8.0 doesn't have g_access, so just use the system access(). */ +#define g_access access +#endif + typedef enum { XML_PASS_CHECK_ONLY = -1, @@ -245,7 +250,8 @@ static void xml_init( void ) { if( ! g_file_test( global.conf->configdir, G_FILE_TEST_EXISTS ) ) log_message( LOGLVL_WARNING, "The configuration directory `%s' does not exist. Configuration won't be saved.", global.conf->configdir ); - else if( ! g_file_test( global.conf->configdir, G_FILE_TEST_EXISTS ) || g_access( global.conf->configdir, W_OK ) != 0 ) + else if( ! g_file_test( global.conf->configdir, G_FILE_TEST_EXISTS ) || + g_access( global.conf->configdir, W_OK ) != 0 ) log_message( LOGLVL_WARNING, "Permission problem: Can't read/write from/to `%s'.", global.conf->configdir ); } |