Przeglądaj źródła

merge patch from Colin to fix error message from getaddrinfo() (#703603)

Michael Vogt 13 lat temu
rodzic
commit
945d2a8aee
2 zmienionych plików z 8 dodań i 0 usunięć
  1. 5 0
      debian/changelog
  2. 3 0
      methods/connect.cc

+ 5 - 0
debian/changelog

@@ -8,6 +8,11 @@ apt (0.9.7.8~exp3) UNRELEASEDexperimental; urgency=low
   * test/integration/framework:
     - continue after test failure but preserve exit status
 
+  [ Colin Watson ]
+  * methods/connect.cc:
+    - provide useful error message in case of EAI_SYSTEM
+      (closes: #703603)
+
  -- Michael Vogt <mvo@debian.org>  Sun, 17 Mar 2013 19:46:23 +0100
 
 apt (0.9.7.8~exp2) experimental; urgency=low

+ 3 - 0
methods/connect.cc

@@ -197,6 +197,9 @@ bool Connect(std::string Host,int Port,const char *Service,int DefPort,int &Fd,
 	       return _error->Error(_("Temporary failure resolving '%s'"),
 				    Host.c_str());
 	    }
+	    if (Res == EAI_SYSTEM)
+	       return _error->Error(_("System error resolving '%s:%s' (%s)"),
+				    Host.c_str(),ServStr,strerror(errno));
 	    return _error->Error(_("Something wicked happened resolving '%s:%s' (%i - %s)"),
 				 Host.c_str(),ServStr,Res,gai_strerror(Res));
 	 }