From 1445ab46a931069ebd7580c01b9333f9494f3778 Mon Sep 17 00:00:00 2001 From: david Date: Tue, 27 Oct 2009 22:57:50 +0000 Subject: [PATCH] Always print out the "Host is up" line with latency, even without verbosity. --- output.cc | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/output.cc b/output.cc index 1697e1766..4772c724e 100644 --- a/output.cc +++ b/output.cc @@ -1477,23 +1477,21 @@ void write_host_status(Target * currenths, int resolve_all) { /* Ping scan / port scan. */ write_xml_initial_hostinfo(currenths, (currenths->flags & HOST_UP) ? "up" : "down"); - if (o.noportscan || o.verbose) { - if (currenths->flags & HOST_UP) { - log_write(LOG_PLAIN, "Host is up"); - if (o.reason) - log_write(LOG_PLAIN, ", %s", target_reason_str(currenths)); - if (currenths->to.srtt != -1) - log_write(LOG_PLAIN, " (%ss latency)", - num_to_string_sigdigits(currenths->to.srtt / 1000000.0, 2)); - log_write(LOG_PLAIN, ".\n"); + if (currenths->flags & HOST_UP) { + log_write(LOG_PLAIN, "Host is up"); + if (o.reason) + log_write(LOG_PLAIN, ", %s", target_reason_str(currenths)); + if (currenths->to.srtt != -1) + log_write(LOG_PLAIN, " (%ss latency)", + num_to_string_sigdigits(currenths->to.srtt / 1000000.0, 2)); + log_write(LOG_PLAIN, ".\n"); - log_write(LOG_MACHINE, "Host: %s (%s)\tStatus: Up\n", - currenths->targetipstr(), currenths->HostName()); - } else if (o.verbose || resolve_all) { - log_write(resolve_all ? LOG_PLAIN : LOG_STDOUT, "Host is down.\n"); - log_write(LOG_MACHINE, "Host: %s (%s)\tStatus: Down\n", - currenths->targetipstr(), currenths->HostName()); - } + log_write(LOG_MACHINE, "Host: %s (%s)\tStatus: Up\n", + currenths->targetipstr(), currenths->HostName()); + } else if (o.verbose || resolve_all) { + log_write(resolve_all ? LOG_PLAIN : LOG_STDOUT, "Host is down.\n"); + log_write(LOG_MACHINE, "Host: %s (%s)\tStatus: Down\n", + currenths->targetipstr(), currenths->HostName()); } } }