diff options
| author | Jelmer Vernooij <jelmer@samba.org> | 2005-12-08 14:41:53 +0100 | 
|---|---|---|
| committer | Jelmer Vernooij <jelmer@samba.org> | 2005-12-08 14:41:53 +0100 | 
| commit | 1ee6c18cfb5eb03f33a5938b37e357dd3fd2c164 (patch) | |
| tree | 6b6806ac2c13634c7a7c5419e95a0c8bd1fe6884 /unix.c | |
| parent | d636233a518fbe46264230866d4b8ea463f1474e (diff) | |
Add abstraction layer for storage
Diffstat (limited to 'unix.c')
| -rw-r--r-- | unix.c | 16 | 
1 files changed, 10 insertions, 6 deletions
| @@ -51,11 +51,12 @@ int main( int argc, char *argv[] )  	CONF_FILE = g_strdup( CONF_FILE_DEF );  	global.helpfile = g_strdup( HELP_FILE ); -	 +  	global.conf = conf_load( argc, argv );  	if( global.conf == NULL )  		return( 1 ); -	 + +  	if( global.conf->runmode == RUNMODE_INETD )  	{  		i = bitlbee_inetd_init(); @@ -69,6 +70,13 @@ int main( int argc, char *argv[] )  	}  	if( i != 0 )  		return( i ); + +	global.storage = storage_init( global.conf->storage ); +	if ( global.storage == NULL) { +		log_message( LOGLVL_ERROR, "No such storage backend '%s'", global.conf->storage ); +		return( 1 ); +	} +	  	/* Catch some signals to tell the user what's happening before quitting */  	memset( &sig, 0, sizeof( sig ) ); @@ -86,10 +94,6 @@ int main( int argc, char *argv[] )  	if( !getuid() || !geteuid() )  		log_message( LOGLVL_WARNING, "BitlBee is running with root privileges. Why?" ); -	if( access( global.conf->configdir, F_OK ) != 0 ) -		log_message( LOGLVL_WARNING, "The configuration directory %s does not exist. Configuration won't be saved.", CONFIG ); -	else if( access( global.conf->configdir, R_OK ) != 0 || access( global.conf->configdir, W_OK ) != 0 ) -		log_message( LOGLVL_WARNING, "Permission problem: Can't read/write from/to %s.", global.conf->configdir );  	if( help_init( &(global.help) ) == NULL )  		log_message( LOGLVL_WARNING, "Error opening helpfile %s.", HELP_FILE ); | 
