From: arjen Date: Wed, 21 Nov 2007 15:23:32 +0000 (+0000) Subject: Logrunner uses the official hostname (FQDN) instead of the X-Git-Tag: V0_0_11~7 X-Git-Url: http://www.andromeda.nl/gitweb/?p=gnucomo.git;a=commitdiff_plain;h=a53fea6eaf4ef3874d78853e54e16db7eaca4cb9 Logrunner uses the official hostname (FQDN) instead of the hostname returned by gethostname(). --- diff --git a/src/gcm_input/logrunner.cpp b/src/gcm_input/logrunner.cpp index 2de9902..1e92471 100644 --- a/src/gcm_input/logrunner.cpp +++ b/src/gcm_input/logrunner.cpp @@ -2,7 +2,7 @@ * logrunner.c * (c) Peter Roozemaal, feb 2003 * - * $Id: logrunner.cpp,v 1.4 2007-10-27 08:46:21 arjen Exp $ + * $Id: logrunner.cpp,v 1.5 2007-11-21 15:23:32 arjen Exp $ * * 1) compile, * 2) Add 'logfile' elements to the gnucomo configuration file @@ -194,7 +194,16 @@ void xml_header(String type) char buffer[256]; *buffer = 0; gethostname(buffer, sizeof(buffer)); - xsend("\n"); + + // Try to obtain the official name of the host (FQDN) + + host = gethostbyname(buffer); + if (host != NULL) + { + strcpy(buffer, host->h_name); + } + + xsend("\n"); xsend("\n"); xsend("\n"); xsend(buffer);