#include "portab.h"
-static char UNUSED id[] = "$Id: conf.c,v 1.104 2008/02/26 22:04:17 fw Exp $";
+static char UNUSED id[] = "$Id: conf.c,v 1.105 2008/03/18 20:12:47 fw Exp $";
#include "imp.h"
#include <assert.h>
static void Set_Defaults PARAMS(( bool InitServers ));
-static void Read_Config PARAMS(( void ));
+static bool Read_Config PARAMS(( bool ngircd_starting ));
static void Validate_Config PARAMS(( bool TestOnly, bool Rehash ));
static void Handle_GLOBAL PARAMS(( int Line, char *Var, char *Arg ));
GLOBAL void
Conf_Init( void )
{
- Set_Defaults( true );
- Read_Config( );
+ Read_Config( true );
Validate_Config(false, false);
} /* Config_Init */
-GLOBAL void
+GLOBAL bool
Conf_Rehash( void )
{
- Set_Defaults( false );
- Read_Config( );
+ if (!Read_Config(false))
+ return false;
Validate_Config(false, true);
/* Update CLIENT structure of local server */
Client_SetInfo(Client_ThisServer(), Conf_ServerInfo);
+ return true;
} /* Config_Rehash */
char *topic;
Use_Log = false;
- Set_Defaults( true );
- Read_Config( );
+ Read_Config( true );
Validate_Config(true, false);
/* If stdin and stdout ("you can read our nice message and we can
} /* Set_Defaults */
-static void
-Read_Config( void )
+static bool
+Read_Config( bool ngircd_starting )
{
/* Read configuration file. */
/* No configuration file found! */
Config_Error( LOG_ALERT, "Can't read configuration \"%s\": %s",
NGIRCd_ConfFile, strerror( errno ));
+ if (!ngircd_starting)
+ return false;
Config_Error( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE_NAME );
exit( 1 );
}
+ Set_Defaults( ngircd_starting );
+
Config_Error( LOG_INFO, "Reading configuration from \"%s\" ...", NGIRCd_ConfFile );
/* Clean up server configuration structure: mark all already
exit( 1 );
}
}
+ return true;
} /* Read_Config */