From d09218c755724154368e241e99875cb1f1a67e21 Mon Sep 17 00:00:00 2001 From: david Date: Mon, 26 Oct 2009 18:17:08 +0000 Subject: [PATCH] Use targetname, the forward DNS name, in Target::NameIP if it is available, in preference to hostname, the reverse DNS name. NameIP is used to represent the host in output messages. --- Target.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Target.cc b/Target.cc index 044a525ce..76cba6d37 100644 --- a/Target.cc +++ b/Target.cc @@ -325,9 +325,12 @@ void Target::setTargetName(char *name) { const char *Target::NameIP(char *buf, size_t buflen) { assert(buf); assert(buflen > 8); - if (hostname) { + if (targetname) + Snprintf(buf, buflen, "%s (%s)", targetname, targetipstring); + else if (hostname) Snprintf(buf, buflen, "%s (%s)", hostname, targetipstring); - } else Strncpy(buf, targetipstring, buflen); + else + Strncpy(buf, targetipstring, buflen); return buf; }