about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2001-12-27 17:15:29 +0000
committerAlexander Barton <alex@barton.de>2001-12-27 17:15:29 +0000
commitc57a4645dedbf608c7906b571a0e2f411b6cb7f0 (patch)
treebdcea5a5ea153f79b71df206b79e1b575f508b3d /src
parent9d74f9007e5b3d6d8ca1ef78ac58268cbdb19bd8 (diff)
downloadngircd-c57a4645dedbf608c7906b571a0e2f411b6cb7f0.tar.gz
ngircd-c57a4645dedbf608c7906b571a0e2f411b6cb7f0.zip
- der eigene Hostname wird nun komplet (als FQDN) ermittelt.
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/client.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/ngircd/client.c b/src/ngircd/client.c
index 8767c55f..6aca9216 100644
--- a/src/ngircd/client.c
+++ b/src/ngircd/client.c
@@ -9,7 +9,7 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an comBase beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
- * $Id: client.c,v 1.8 2001/12/27 16:54:51 alex Exp $
+ * $Id: client.c,v 1.9 2001/12/27 17:15:29 alex Exp $
  *
  * client.c: Management aller Clients
  *
@@ -21,6 +21,9 @@
  * Server gewesen, so existiert eine entsprechende CONNECTION-Struktur.
  *
  * $Log: client.c,v $
+ * Revision 1.9  2001/12/27 17:15:29  alex
+ * - der eigene Hostname wird nun komplet (als FQDN) ermittelt.
+ *
  * Revision 1.8  2001/12/27 16:54:51  alex
  * - neue Funktion Client_GetID(), liefert die "Client ID".
  *
@@ -56,6 +59,7 @@
 #include <unistd.h>
 #include <stdio.h>
 #include <string.h>
+#include <netdb.h>
 
 #include <exp.h>
 #include "client.h"
@@ -79,6 +83,8 @@ LOCAL CLIENT *New_Client_Struct( VOID );
 
 GLOBAL VOID Client_Init( VOID )
 {
+	struct hostent *h;
+	
 	This_Server = New_Client_Struct( );
 	if( ! This_Server )
 	{
@@ -91,7 +97,11 @@ GLOBAL VOID Client_Init( VOID )
 	This_Server->type = CLIENT_SERVER;
 	This_Server->conn_id = NONE;
 	This_Server->introducer = This_Server;
+
 	gethostname( This_Server->host, CLIENT_HOST_LEN );
+	h = gethostbyname( This_Server->host );
+	if( h ) strcpy( This_Server->host, h->h_name );
+
 	strcpy( This_Server->nick, This_Server->host );
 
 	My_Clients = This_Server;