trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpe...@apache.org
Subject [1/2] git commit: jtest: improve gethostbyname error message
Date Sat, 06 Sep 2014 20:35:18 GMT
Repository: trafficserver
Updated Branches:
  refs/heads/master c07031cc6 -> 4a1d17818


jtest: improve gethostbyname error message


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/a4d903c2
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/a4d903c2
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/a4d903c2

Branch: refs/heads/master
Commit: a4d903c2b8cc01e7846bd6abee6c03bb1ac37fd8
Parents: c07031c
Author: James Peach <jpeach@apache.org>
Authored: Sat Sep 6 12:50:21 2014 -0700
Committer: James Peach <jpeach@apache.org>
Committed: Sat Sep 6 12:50:21 2014 -0700

----------------------------------------------------------------------
 tools/jtest/jtest.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a4d903c2/tools/jtest/jtest.cc
----------------------------------------------------------------------
diff --git a/tools/jtest/jtest.cc b/tools/jtest/jtest.cc
index fb8c704..7ddacac 100644
--- a/tools/jtest/jtest.cc
+++ b/tools/jtest/jtest.cc
@@ -1655,14 +1655,14 @@ static void init_client(int sock) {
   poll_set(sock,NULL,write_request);
 }
 
-static unsigned int get_addr(char * host) {
+static unsigned int get_addr(const char * host) {
   unsigned int addr = inet_addr(host);
   struct hostent *host_info = NULL;
 
   if (!addr || (-1 == (int)addr)) {
     host_info = gethostbyname(host);
     if (!host_info) {
-      perror ("gethostbyname");
+      printf("gethostbyname(%s): %s\n", host, hstrerror(h_errno));
       return (unsigned int)-1;
     }
     addr = *((unsigned int*) host_info->h_addr);


Mime
View raw message