Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • storage_xml.c

    r88d2208 r5f5d433  
    3030#include "md5.h"
    3131#include <glib/gstdio.h>
    32 
    33 #if GLIB_CHECK_VERSION(2,8,0)
    34 #include <glib/gstdio.h>
    35 #else
    36 /* GLib < 2.8.0 doesn't have g_access, so just use the system access(). */
    37 #include <unistd.h>
    38 #define g_access access
    39 #endif
    4032
    4133typedef enum
     
    252244static void xml_init( void )
    253245{
    254         if( g_access( global.conf->configdir, F_OK ) != 0 )
     246        if( ! g_file_test( global.conf->configdir, G_FILE_TEST_EXISTS ) )
    255247                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 )
    258249                log_message( LOGLVL_WARNING, "Permission problem: Can't read/write from/to `%s'.", global.conf->configdir );
    259250}
     
    382373        g_free( path2 );
    383374       
    384         if( !overwrite && g_access( path, F_OK ) == 0 )
     375        if( !overwrite && g_file_test( path, G_FILE_TEST_EXISTS ) )
    385376                return STORAGE_ALREADY_EXISTS;
    386377       
     
    490481static storage_status_t xml_remove( const char *nick, const char *password )
    491482{
    492         char s[512], *lc;
     483        char s[512];
    493484        storage_status_t status;
    494485
     
    497488                return status;
    498489
    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" );
    504491        if( unlink( s ) == -1 )
    505492                return STORAGE_OTHER_ERROR;
Note: See TracChangeset for help on using the changeset viewer.