Changeset ec3e411 for conf.c


Ignore:
Timestamp:
2006-02-12T07:20:49Z (18 years ago)
Author:
Jelmer Vernooij <jelmer@…>
Branches:
master
Children:
58bc4e6
Parents:
9fae35c (diff), 1d2e3c2 (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:

Merge Wilmer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • conf.c

    r9fae35c rec3e411  
    3232#include "ini.h"
    3333#include "url.h"
     34#include "ipc.h"
    3435
    3536#include "protocols/proxy.h"
     
    6162        conf->configdir = g_strdup( CONFIG );
    6263        conf->plugindir = g_strdup( PLUGINDIR );
     64        conf->pidfile = g_strdup( "/var/run/bitlbee.pid" );
    6365        conf->motdfile = g_strdup( ETCDIR "/motd.txt" );
    6466        conf->ping_interval = 180;
     
    7779        }
    7880       
    79         while( argc > 0 && ( opt = getopt( argc, argv, "i:p:nvIDFc:d:h" ) ) >= 0 )
     81        while( argc > 0 && ( opt = getopt( argc, argv, "i:p:P:nvIDFc:d:hR:" ) ) >= 0 )
    8082        /*     ^^^^ Just to make sure we skip this step from the REHASH handler. */
    8183        {
     
    9294                        }
    9395                        conf->port = i;
     96                }
     97                else if( opt == 'p' )
     98                {
     99                        g_free( conf->pidfile );
     100                        conf->pidfile = g_strdup( optarg );
    94101                }
    95102                else if( opt == 'n' )
     
    142149                        return( NULL );
    143150                }
     151                else if( opt == 'R' )
     152                {
     153                        /* We can't load the statefile yet (and should make very sure we do this
     154                           only once), so set the filename here and load the state information
     155                           when initializing ForkDaemon. (This option only makes sense in that
     156                           mode anyway!) */
     157                        ipc_master_set_statefile( optarg );
     158                }
    144159        }
    145160       
     
    175190                                else
    176191                                        conf->runmode = RUNMODE_INETD;
     192                        }
     193                        else if( g_strcasecmp( ini->key, "pidfile" ) == 0 )
     194                        {
     195                                g_free( conf->pidfile );
     196                                conf->pidfile = g_strdup( ini->value );
    177197                        }
    178198                        else if( g_strcasecmp( ini->key, "daemoninterface" ) == 0 )
Note: See TracChangeset for help on using the changeset viewer.