diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2008-06-10 00:29:36 +0100 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2008-06-10 00:29:36 +0100 | 
| commit | b6cd9e9fe0aa86e83fc4a43b3db2240839e2103a (patch) | |
| tree | aabd166c11bb46f150623f249d207b0497b240d6 /storage_xml.c | |
| parent | de8e584d7f4fea214934af094a4df2672d7e0be8 (diff) | |
| parent | 783e9b76de9a8ec16e8229d7c476b16ba8011554 (diff) | |
The merge from the future. 2025 is going to be awesome. :-)
Diffstat (limited to 'storage_xml.c')
| -rw-r--r-- | storage_xml.c | 7 | 
1 files changed, 4 insertions, 3 deletions
| diff --git a/storage_xml.c b/storage_xml.c index f37fce44..ab7da6e3 100644 --- a/storage_xml.c +++ b/storage_xml.c @@ -28,6 +28,7 @@  #include "base64.h"  #include "arc.h"  #include "md5.h" +#include <glib/gstdio.h>  typedef enum  { @@ -242,9 +243,9 @@ GMarkupParser xml_parser =  static void xml_init( void )  { -	if( access( global.conf->configdir, F_OK ) != 0 ) +	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( access( global.conf->configdir, R_OK ) != 0 || 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 );  } @@ -371,7 +372,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 && access( path, F_OK ) != -1 ) +	if( !overwrite && g_file_test( path, G_FILE_TEST_EXISTS ) )  		return STORAGE_ALREADY_EXISTS;  	strcat( path, "~" ); | 
