Changes in storage_xml.c [88d2208:5f5d433]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
storage_xml.c
r88d2208 r5f5d433 30 30 #include "md5.h" 31 31 #include <glib/gstdio.h> 32 33 #if GLIB_CHECK_VERSION(2,8,0)34 #include <glib/gstdio.h>35 #else36 /* GLib < 2.8.0 doesn't have g_access, so just use the system access(). */37 #include <unistd.h>38 #define g_access access39 #endif40 32 41 33 typedef enum … … 252 244 static void xml_init( void ) 253 245 { 254 if( g_access( global.conf->configdir, F_OK ) != 0)246 if( ! g_file_test( global.conf->configdir, G_FILE_TEST_EXISTS ) ) 255 247 log_message( LOGLVL_WARNING, "The configuration directory `%s' does not exist. Configuration won't be saved.", global.conf->configdir ); 256 else if( g_access( global.conf->configdir, F_OK ) != 0 || 257 g_access( global.conf->configdir, W_OK ) != 0 ) 248 else if( ! g_file_test( global.conf->configdir, G_FILE_TEST_EXISTS ) || g_access( global.conf->configdir, W_OK ) != 0 ) 258 249 log_message( LOGLVL_WARNING, "Permission problem: Can't read/write from/to `%s'.", global.conf->configdir ); 259 250 } … … 382 373 g_free( path2 ); 383 374 384 if( !overwrite && g_ access( path, F_OK ) == 0)375 if( !overwrite && g_file_test( path, G_FILE_TEST_EXISTS ) ) 385 376 return STORAGE_ALREADY_EXISTS; 386 377 … … 490 481 static storage_status_t xml_remove( const char *nick, const char *password ) 491 482 { 492 char s[512] , *lc;483 char s[512]; 493 484 storage_status_t status; 494 485 … … 497 488 return status; 498 489 499 lc = g_strdup( nick ); 500 nick_lc( lc ); 501 g_snprintf( s, 511, "%s%s%s", global.conf->configdir, lc, ".xml" ); 502 g_free( lc ); 503 490 g_snprintf( s, 511, "%s%s%s", global.conf->configdir, nick, ".xml" ); 504 491 if( unlink( s ) == -1 ) 505 492 return STORAGE_OTHER_ERROR;
Note: See TracChangeset
for help on using the changeset viewer.