Changeset dfd442b


Ignore:
Timestamp:
2008-06-29T23:45:11Z (16 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
6a78c0e
Parents:
f5d1b31
Message:

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. :-/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • storage_xml.c

    rf5d1b31 rdfd442b  
    249249static void xml_init( void )
    250250{
    251         if( ! g_file_test( global.conf->configdir, G_FILE_TEST_EXISTS ) )
     251        if( g_access( global.conf->configdir, F_OK ) != 0 )
    252252                log_message( LOGLVL_WARNING, "The configuration directory `%s' does not exist. Configuration won't be saved.", global.conf->configdir );
    253         else if( ! g_file_test( global.conf->configdir, G_FILE_TEST_EXISTS ) ||
    254                         g_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 )
    255255                log_message( LOGLVL_WARNING, "Permission problem: Can't read/write from/to `%s'.", global.conf->configdir );
    256256}
     
    379379        g_free( path2 );
    380380       
    381         if( !overwrite && g_file_test( path, G_FILE_TEST_EXISTS ) )
     381        if( !overwrite && g_access( path, F_OK ) == 0 )
    382382                return STORAGE_ALREADY_EXISTS;
    383383       
Note: See TracChangeset for help on using the changeset viewer.