Changeset b308cf9 for unix.c


Ignore:
Timestamp:
2010-06-05T23:21:02Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
1fdb0a4
Parents:
3ab1d31 (diff), e774815 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merging libpurple branch into killerbee. It's fairly usable already, and
Debian packaging is now properly separated. This also picks up a load of
stuff from mainline it seems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • unix.c

    r3ab1d31 rb308cf9  
    5656       
    5757        log_init();
     58       
    5859        global.conf_file = g_strdup( CONF_FILE_DEF );
    5960        global.conf = conf_load( argc, argv );
     
    6263       
    6364        b_main_init();
    64         nogaim_init();
    6565       
    6666        srand( time( NULL ) ^ getpid() );
     67       
    6768        global.helpfile = g_strdup( HELP_FILE );
     69        if( help_init( &global.help, global.helpfile ) == NULL )
     70                log_message( LOGLVL_WARNING, "Error opening helpfile %s.", HELP_FILE );
     71
     72        global.storage = storage_init( global.conf->primary_storage, global.conf->migrate_storage );
     73        if( global.storage == NULL )
     74        {
     75                log_message( LOGLVL_ERROR, "Unable to load storage backend '%s'", global.conf->primary_storage );
     76                return( 1 );
     77        }
    6878       
    6979        if( global.conf->runmode == RUNMODE_INETD )
     
    7383       
    7484                i = bitlbee_inetd_init();
    75                 log_message( LOGLVL_INFO, "Bitlbee %s starting in inetd mode.", BITLBEE_VERSION );
     85                log_message( LOGLVL_INFO, "BitlBee %s starting in inetd mode.", BITLBEE_VERSION );
    7686
    7787        }
    7888        else if( global.conf->runmode == RUNMODE_DAEMON )
    7989        {
    80                 log_link( LOGLVL_ERROR, LOGOUTPUT_SYSLOG );
    81                 log_link( LOGLVL_WARNING, LOGOUTPUT_SYSLOG );
     90                log_link( LOGLVL_ERROR, LOGOUTPUT_CONSOLE );
     91                log_link( LOGLVL_WARNING, LOGOUTPUT_CONSOLE );
    8292
    8393                i = bitlbee_daemon_init();
    84                 log_message( LOGLVL_INFO, "Bitlbee %s starting in daemon mode.", BITLBEE_VERSION );
     94                log_message( LOGLVL_INFO, "BitlBee %s starting in daemon mode.", BITLBEE_VERSION );
    8595        }
    8696        else if( global.conf->runmode == RUNMODE_FORKDAEMON )
    8797        {
     98                log_link( LOGLVL_ERROR, LOGOUTPUT_CONSOLE );
     99                log_link( LOGLVL_WARNING, LOGOUTPUT_CONSOLE );
     100
    88101                /* In case the operator requests a restart, we need this. */
    89102                old_cwd = g_malloc( 256 );
     
    96109               
    97110                i = bitlbee_daemon_init();
    98                 log_message( LOGLVL_INFO, "Bitlbee %s starting in forking daemon mode.", BITLBEE_VERSION );
     111                log_message( LOGLVL_INFO, "BitlBee %s starting in forking daemon mode.", BITLBEE_VERSION );
    99112        }
    100113        if( i != 0 )
     
    113126                        setuid( pw->pw_uid );
    114127                }
    115         }
    116 
    117         global.storage = storage_init( global.conf->primary_storage, global.conf->migrate_storage );
    118         if( global.storage == NULL )
    119         {
    120                 log_message( LOGLVL_ERROR, "Unable to load storage backend '%s'", global.conf->primary_storage );
    121                 return( 1 );
    122128        }
    123129       
     
    139145        if( !getuid() || !geteuid() )
    140146                log_message( LOGLVL_WARNING, "BitlBee is running with root privileges. Why?" );
    141         if( help_init( &global.help, global.helpfile ) == NULL )
    142                 log_message( LOGLVL_WARNING, "Error opening helpfile %s.", HELP_FILE );
    143147       
    144148        b_main_run();
Note: See TracChangeset for help on using the changeset viewer.