]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/ngircd.c
Do not exit unconditionally if config file cannot be opened
[ngircd-alex.git] / src / ngircd / ngircd.c
index 1eb68b4c94f824950e6b239a5641bff22dbc8ae6..bb88b3b97fca68641c04c6095822fa828863346d 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: ngircd.c,v 1.116 2007/11/15 01:03:01 fw Exp $";
+static char UNUSED id[] = "$Id: ngircd.c,v 1.119 2008/03/18 20:12:47 fw Exp $";
 
 /**
  * @file
@@ -397,7 +397,12 @@ Fill_Version( void )
 
        strlcat( NGIRCd_VersionAddition, "IRCPLUS", sizeof NGIRCd_VersionAddition );
 #endif
+#ifdef WANT_IPV6
+       if (NGIRCd_VersionAddition[0])
+               strlcat(NGIRCd_VersionAddition, "+", sizeof(NGIRCd_VersionAddition));
 
+       strlcat(NGIRCd_VersionAddition, "IPv6", sizeof(NGIRCd_VersionAddition));
+#endif
        if( NGIRCd_VersionAddition[0] )
                strlcat( NGIRCd_VersionAddition, "-", sizeof( NGIRCd_VersionAddition ));
 
@@ -422,24 +427,31 @@ GLOBAL void
 NGIRCd_Rehash( void )
 {
        char old_name[CLIENT_ID_LEN];
+       unsigned old_nicklen;
 
        Log( LOG_NOTICE|LOG_snotice, "Re-reading configuration NOW!" );
        NGIRCd_SignalRehash = false;
 
-       /* Close down all listening sockets */
-       Conn_ExitListeners( );
-
-       /* Remember old server name */
+       /* Remember old server name and nick name length */
        strlcpy( old_name, Conf_ServerName, sizeof old_name );
+       old_nicklen = Conf_MaxNickLength;
 
        /* Re-read configuration ... */
-       Conf_Rehash( );
+       if (!Conf_Rehash( ))
+               return;
 
-       /* Recover old server name: it can't be changed during run-time */
-       if( strcmp( old_name, Conf_ServerName ) != 0 )
-       {
-               strlcpy( Conf_ServerName, old_name, sizeof Conf_ServerName );
-               Log( LOG_ERR, "Can't change \"ServerName\" on runtime! Ignored new name." );
+       /* Close down all listening sockets */
+       Conn_ExitListeners( );
+
+       /* Recover old server name and nick name length: these values can't
+        * be changed during run-time */
+       if (strcmp(old_name, Conf_ServerName) != 0 ) {
+               strlcpy(Conf_ServerName, old_name, sizeof Conf_ServerName);
+               Log(LOG_ERR, "Can't change \"ServerName\" on runtime! Ignored new name.");
+       }
+       if (old_nicklen != Conf_MaxNickLength) {
+               Conf_MaxNickLength = old_nicklen;
+               Log(LOG_ERR, "Can't change \"MaxNickLength\" on runtime! Ignored new value.");
        }
 
        /* Create new pre-defined channels */