+ STATIC CHAR version[126];
+
+#ifdef CVSDATE
+ sprintf( version, "%s %s(%s)-%s", PACKAGE_NAME, PACKAGE_VERSION, CVSDATE, NGIRCd_VersionAddition( ));
+#else
+ sprintf( version, "%s %s-%s", PACKAGE_NAME, PACKAGE_VERSION, NGIRCd_VersionAddition( ));
+#endif
+ return version;
+} /* NGIRCd_Version */
+
+
+GLOBAL CHAR *
+NGIRCd_VersionAddition( VOID )
+{
+ STATIC CHAR txt[200];
+
+ strcpy( txt, "" );
+
+#ifdef SYSLOG
+ if( txt[0] ) strcat( txt, "+" );
+ strcat( txt, "SYSLOG" );
+#endif
+#ifdef ZLIB
+ if( txt[0] ) strcat( txt, "+" );
+ strcat( txt, "ZLIB" );
+#endif
+#ifdef TCPWRAP
+ if( txt[0] ) strcat( txt, "+" );
+ strcat( txt, "TCPWRAP" );
+#endif
+#ifdef RENDEZVOUS
+ if( txt[0] ) strcat( txt, "+" );
+ strcat( txt, "RENDEZVOUS" );
+#endif
+#ifdef IDENTAUTH
+ if( txt[0] ) strcat( txt, "+" );
+ strcat( txt, "IDENT" );
+#endif
+#ifdef DEBUG
+ if( txt[0] ) strcat( txt, "+" );
+ strcat( txt, "DEBUG" );
+#endif
+#ifdef SNIFFER
+ if( txt[0] ) strcat( txt, "+" );
+ strcat( txt, "SNIFFER" );
+#endif
+#ifdef STRICT_RFC
+ if( txt[0] ) strcat( txt, "+" );
+ strcat( txt, "RFC" );
+#endif
+#ifdef IRCPLUS
+ if( txt[0] ) strcat( txt, "+" );
+ strcat( txt, "IRCPLUS" );
+#endif
+
+ if( txt[0] ) strlcat( txt, "-", sizeof( txt ));
+ strlcat( txt, TARGET_CPU, sizeof( txt ));
+ strlcat( txt, "/", sizeof( txt ));
+ strlcat( txt, TARGET_VENDOR, sizeof( txt ));
+ strlcat( txt, "/", sizeof( txt ));
+ strlcat( txt, TARGET_OS, sizeof( txt ));
+
+ return txt;
+} /* NGIRCd_VersionAddition */
+
+
+GLOBAL VOID
+NGIRCd_Rehash( VOID )
+{
+ CHAR old_name[CLIENT_ID_LEN];
+
+ Log( LOG_NOTICE|LOG_snotice, "Re-reading configuration NOW!" );
+ NGIRCd_SignalRehash = FALSE;
+
+ /* Alle Listen-Sockets schliessen */
+ Conn_ExitListeners( );
+
+ /* Alten Server-Namen merken */
+#ifdef DEBUG
+ assert( sizeof( old_name ) == sizeof( Conf_ServerName ));
+#endif
+ strcpy( old_name, Conf_ServerName );
+
+ /* Konfiguration neu lesen ... */
+ Conf_Rehash( );
+
+ /* Alten Server-Namen wiederherstellen: dieser
+ * kann nicht zur Laufzeit geaendert werden ... */
+ if( strcmp( old_name, Conf_ServerName ) != 0 )
+ {
+ strcpy( Conf_ServerName, old_name );
+ Log( LOG_ERR, "Can't change \"ServerName\" on runtime! Ignored new name." );
+ }
+
+ /* neue pre-defined Channel anlegen: */
+ Channel_InitPredefined( );
+
+ /* Listen-Sockets neu anlegen: */
+ Conn_InitListeners( );
+
+ /* Sync configuration with established connections */
+ Conn_SyncServerStruct( );
+
+ Log( LOG_NOTICE|LOG_snotice, "Re-reading of configuration done." );
+} /* NGIRCd_Rehash */
+
+
+LOCAL VOID
+Initialize_Signal_Handler( VOID )
+{
+ /* Signal-Handler initialisieren: einige Signale
+ * werden ignoriert, andere speziell behandelt. */
+
+#ifdef HAVE_SIGACTION
+ /* sigaction() ist vorhanden */
+
+ struct sigaction saction;
+
+ /* Signal-Struktur initialisieren */
+ memset( &saction, 0, sizeof( saction ));
+ saction.sa_handler = Signal_Handler;
+#ifdef SA_RESTART
+ saction.sa_flags |= SA_RESTART;
+#endif
+#ifdef SA_NOCLDWAIT
+ saction.sa_flags |= SA_NOCLDWAIT;
+#endif
+
+ /* Signal-Handler einhaengen */
+ sigaction( SIGINT, &saction, NULL );
+ sigaction( SIGQUIT, &saction, NULL );
+ sigaction( SIGTERM, &saction, NULL);
+ sigaction( SIGHUP, &saction, NULL);
+ sigaction( SIGCHLD, &saction, NULL);
+
+ /* einige Signale ignorieren */
+ saction.sa_handler = SIG_IGN;
+ sigaction( SIGPIPE, &saction, NULL );
+#else
+ /* kein sigaction() vorhanden */
+
+ /* Signal-Handler einhaengen */
+ signal( SIGINT, Signal_Handler );
+ signal( SIGQUIT, Signal_Handler );
+ signal( SIGTERM, Signal_Handler );
+ signal( SIGHUP, Signal_Handler );
+ signal( SIGCHLD, Signal_Handler );
+
+ /* einige Signale ignorieren */
+ signal( SIGPIPE, SIG_IGN );
+#endif
+} /* Initialize_Signal_Handler */
+
+
+LOCAL VOID
+Signal_Handler( INT Signal )
+{
+ /* Signal-Handler. Dieser wird aufgerufen, wenn eines der Signale eintrifft,
+ * fuer das wir uns registriert haben (vgl. Initialize_Signal_Handler). Die
+ * Nummer des eingetroffenen Signals wird der Funktion uebergeben. */
+