Changeset 8661caa for storage_xml.c
- Timestamp:
- 2008-08-04T14:45:24Z (16 years ago)
- Branches:
- master
- Children:
- 87f525e
- Parents:
- 4ac647d (diff), 718e05f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
storage_xml.c
r4ac647d r8661caa 29 29 #include "arc.h" 30 30 #include "md5.h" 31 #include <glib/gstdio.h> 32 33 #if !GLIB_CHECK_VERSION(2,8,0) 34 /* GLib < 2.8.0 doesn't have g_access, so just use the system access(). */ 35 #define g_access access 36 #endif 31 37 32 38 typedef enum … … 243 249 static void xml_init( void ) 244 250 { 245 if( access( global.conf->configdir, F_OK ) != 0 )251 if( g_access( global.conf->configdir, F_OK ) != 0 ) 246 252 log_message( LOGLVL_WARNING, "The configuration directory `%s' does not exist. Configuration won't be saved.", global.conf->configdir ); 247 else if( access( global.conf->configdir, R_OK ) != 0 || access( global.conf->configdir, W_OK ) != 0 ) 253 else if( g_access( global.conf->configdir, F_OK ) != 0 || 254 g_access( global.conf->configdir, W_OK ) != 0 ) 248 255 log_message( LOGLVL_WARNING, "Permission problem: Can't read/write from/to `%s'.", global.conf->configdir ); 249 256 } … … 372 379 g_free( path2 ); 373 380 374 if( !overwrite && access( path, F_OK ) != -1)381 if( !overwrite && g_access( path, F_OK ) == 0 ) 375 382 return STORAGE_ALREADY_EXISTS; 376 383 … … 480 487 static storage_status_t xml_remove( const char *nick, const char *password ) 481 488 { 482 char s[512] ;489 char s[512], *lc; 483 490 storage_status_t status; 484 491 … … 487 494 return status; 488 495 489 g_snprintf( s, 511, "%s%s%s", global.conf->configdir, nick, ".xml" ); 496 lc = g_strdup( nick ); 497 nick_lc( lc ); 498 g_snprintf( s, 511, "%s%s%s", global.conf->configdir, lc, ".xml" ); 499 g_free( lc ); 500 490 501 if( unlink( s ) == -1 ) 491 502 return STORAGE_OTHER_ERROR;
Note: See TracChangeset
for help on using the changeset viewer.