Changeset 5674207 for unix.c


Ignore:
Timestamp:
2009-11-28T19:51:39Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
a19ea7a
Parents:
3e7b640
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • unix.c

    r3e7b640 r5674207  
    4747       
    4848        log_init();
     49       
    4950        global.conf_file = g_strdup( CONF_FILE_DEF );
    5051        global.conf = conf_load( argc, argv );
     
    5354       
    5455        b_main_init();
    55         nogaim_init();
    5656       
    5757        srand( time( NULL ) ^ getpid() );
     58       
    5859        global.helpfile = g_strdup( HELP_FILE );
     60        if( help_init( &global.help, global.helpfile ) == NULL )
     61                log_message( LOGLVL_WARNING, "Error opening helpfile %s.", HELP_FILE );
     62
     63        global.storage = storage_init( global.conf->primary_storage, global.conf->migrate_storage );
     64        if( global.storage == NULL )
     65        {
     66                log_message( LOGLVL_ERROR, "Unable to load storage backend '%s'", global.conf->primary_storage );
     67                return( 1 );
     68        }
    5969       
    6070        if( global.conf->runmode == RUNMODE_INETD )
     
    104114                        setuid( pw->pw_uid );
    105115                }
    106         }
    107 
    108         global.storage = storage_init( global.conf->primary_storage, global.conf->migrate_storage );
    109         if( global.storage == NULL )
    110         {
    111                 log_message( LOGLVL_ERROR, "Unable to load storage backend '%s'", global.conf->primary_storage );
    112                 return( 1 );
    113116        }
    114117       
     
    130133        if( !getuid() || !geteuid() )
    131134                log_message( LOGLVL_WARNING, "BitlBee is running with root privileges. Why?" );
    132         if( help_init( &global.help, global.helpfile ) == NULL )
    133                 log_message( LOGLVL_WARNING, "Error opening helpfile %s.", HELP_FILE );
    134135       
    135136        b_main_run();
Note: See TracChangeset for help on using the changeset viewer.