From a53fea6eaf4ef3874d78853e54e16db7eaca4cb9 Mon Sep 17 00:00:00 2001 From: arjen Date: Wed, 21 Nov 2007 15:23:32 +0000 Subject: [PATCH] Logrunner uses the official hostname (FQDN) instead of the hostname returned by gethostname(). --- src/gcm_input/logrunner.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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); -- 2.11.0