From 5674207b09a856149c110040f7f672182a04dee5 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 28 Nov 2009 19:51:39 +0000 Subject: Reshuffled initialization sequence a little bit. Most important change: nogaim_init() should be done after fork() to make ForkDaemon mode work again. Also, doing help_init() earlie makes "help purple" work. --- unix.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'unix.c') diff --git a/unix.c b/unix.c index 56b0ab46..18b2f83f 100644 --- a/unix.c +++ b/unix.c @@ -46,16 +46,26 @@ int main( int argc, char *argv[] ) struct sigaction sig, old; log_init(); + global.conf_file = g_strdup( CONF_FILE_DEF ); global.conf = conf_load( argc, argv ); if( global.conf == NULL ) return( 1 ); b_main_init(); - nogaim_init(); srand( time( NULL ) ^ getpid() ); + global.helpfile = g_strdup( HELP_FILE ); + if( help_init( &global.help, global.helpfile ) == NULL ) + log_message( LOGLVL_WARNING, "Error opening helpfile %s.", HELP_FILE ); + + global.storage = storage_init( global.conf->primary_storage, global.conf->migrate_storage ); + if( global.storage == NULL ) + { + log_message( LOGLVL_ERROR, "Unable to load storage backend '%s'", global.conf->primary_storage ); + return( 1 ); + } if( global.conf->runmode == RUNMODE_INETD ) { @@ -104,13 +114,6 @@ int main( int argc, char *argv[] ) setuid( pw->pw_uid ); } } - - global.storage = storage_init( global.conf->primary_storage, global.conf->migrate_storage ); - if( global.storage == NULL ) - { - log_message( LOGLVL_ERROR, "Unable to load storage backend '%s'", global.conf->primary_storage ); - return( 1 ); - } /* Catch some signals to tell the user what's happening before quitting */ memset( &sig, 0, sizeof( sig ) ); @@ -129,8 +132,6 @@ int main( int argc, char *argv[] ) if( !getuid() || !geteuid() ) log_message( LOGLVL_WARNING, "BitlBee is running with root privileges. Why?" ); - if( help_init( &global.help, global.helpfile ) == NULL ) - log_message( LOGLVL_WARNING, "Error opening helpfile %s.", HELP_FILE ); b_main_run(); -- cgit v1.2.3 From badd1484469ab6280de977eb179db00820868c03 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Tue, 13 Jul 2010 00:22:53 +0100 Subject: Reformat nicks whenever fullname/nick/group changes (but at least for now still only for offline users). --- unix.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'unix.c') diff --git a/unix.c b/unix.c index f559705e..a9045c44 100644 --- a/unix.c +++ b/unix.c @@ -38,6 +38,7 @@ #include #include #include +#include global_t global; /* Against global namespace pollution */ @@ -51,6 +52,10 @@ int main( int argc, char *argv[] ) char *old_cwd = NULL; struct sigaction sig, old; + /* Required to make iconv to ASCII//TRANSLIT work. This makes BitlBee + system-locale-sensitive. :-( */ + setlocale( LC_CTYPE, "" ); + if( argc > 1 && strcmp( argv[1], "-x" ) == 0 ) return crypt_main( argc, argv ); -- cgit v1.2.3