aboutsummaryrefslogtreecommitdiffstats
path: root/storage_xml.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2008-06-30 00:45:11 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2008-06-30 00:45:11 +0100
commitdfd442b384ff04de537b399fd7e42ed01b62cf10 (patch)
tree2713cf2cf98fab1d4953a4b6a01008196e7df1dd /storage_xml.c
parentf5d1b3185140e690a6503b9e68c7ea28655b405e (diff)
Just use g_access() everywhere instead of a mix of that and g_file_test().
g_file_test() can't test for writability, and g_access() doesn't exist in older GLibs. :-/
Diffstat (limited to 'storage_xml.c')
-rw-r--r--storage_xml.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/storage_xml.c b/storage_xml.c
index cb92135c..240206f1 100644
--- a/storage_xml.c
+++ b/storage_xml.c
@@ -248,10 +248,10 @@ GMarkupParser xml_parser =
static void xml_init( void )
{
- if( ! g_file_test( global.conf->configdir, G_FILE_TEST_EXISTS ) )
+ if( g_access( global.conf->configdir, F_OK ) != 0 )
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_access( global.conf->configdir, F_OK ) != 0 ||
+ g_access( global.conf->configdir, W_OK ) != 0 )
log_message( LOGLVL_WARNING, "Permission problem: Can't read/write from/to `%s'.", global.conf->configdir );
}
@@ -378,7 +378,7 @@ static storage_status_t xml_save( irc_t *irc, int overwrite )
g_snprintf( path, sizeof( path ) - 2, "%s%s%s", global.conf->configdir, path2, ".xml" );
g_free( path2 );
- if( !overwrite && g_file_test( path, G_FILE_TEST_EXISTS ) )
+ if( !overwrite && g_access( path, F_OK ) == 0 )
return STORAGE_ALREADY_EXISTS;
strcat( path, "~" );