tag 329745 patch
forwarded 329745
quit

Here's a patch which adds correct handling of errors from getaddrinfo.

Thanks,
Ryan

-- 
_________________________
Ryan Niebur
ryanrya...@gmail.com
--- a/mtr.c
+++ b/mtr.c
@@ -402,7 +402,11 @@
   hints.ai_socktype = SOCK_DGRAM;
   error = getaddrinfo( Hostname, NULL, &hints, &res );
   if ( error ) {
-    perror( gai_strerror(error) );
+    if(error == EAI_SYSTEM) {
+      perror("Failed to resolve host");
+    } else {
+        printf("Failed to resolve host: %s\n", gai_strerror(error));
+    }
     exit( EXIT_FAILURE );
   }
   /* Convert the first addrinfo into a hostent. */

Attachment: signature.asc
Description: Digital signature

Reply via email to