diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2006-01-15 21:31:59 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2006-01-15 21:31:59 +0100 |
commit | f4a59408250b76173418fad090d4623e5300c90f (patch) | |
tree | 1eb79bd250b9c5f5c4ed2de8ffd5202f0575b819 /conf.c | |
parent | 6fda35070cadc83a6b78c85896fcaf85299e5ad8 (diff) |
Added REHASH command, IPC emulation in daemon (non-forked) mode.
Diffstat (limited to 'conf.c')
-rw-r--r-- | conf.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -63,6 +63,7 @@ conf_t *conf_load( int argc, char *argv[] ) conf->motdfile = g_strdup( ETCDIR "/motd.txt" ); conf->ping_interval = 180; conf->ping_timeout = 300; + proxytype = 0; i = conf_loadini( conf, CONF_FILE ); if( i == 0 ) @@ -75,7 +76,8 @@ conf_t *conf_load( int argc, char *argv[] ) fprintf( stderr, "Warning: Unable to read configuration file `%s'.\n", CONF_FILE ); } - while( ( opt = getopt( argc, argv, "i:p:nvIDFc:d:h" ) ) >= 0 ) + while( argc > 0 && ( opt = getopt( argc, argv, "i:p:nvIDFc:d:h" ) ) >= 0 ) + /* ^^^^ Just to make sure we skip this step from the REHASH handler. */ { if( opt == 'i' ) { @@ -107,7 +109,9 @@ conf_t *conf_load( int argc, char *argv[] ) g_free( CONF_FILE ); CONF_FILE = g_strdup( optarg ); g_free( conf ); - /* Re-evaluate arguments. */ + /* Re-evaluate arguments. Don't use this option twice, + you'll end up in an infinite loop! Hope this trick + works with all libcs BTW.. */ optind = 1; return( conf_load( argc, argv ) ); } |