shithub: 9pro

Download patch

ref: ab5c0717baeddf5218a602508c9c72d67de797f5
parent: d79335d57a7f6f608e8caf800b74155a299a550c
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Fri Apr 30 10:28:39 EDT 2021

9gc: print getaddrinfo error if any

--- a/9gc.c
+++ b/9gc.c
@@ -138,8 +138,10 @@
 		return -1;
 	}
 	port++;
-	if ((e = getaddrinfo(host, port, &hint, &r)) != 0)
+	if ((e = getaddrinfo(host, port, &hint, &r)) != 0){
+		fprintf(stderr, "%s: %s\n", gai_strerror(e), s);
 		return -1;
+	}
 	f = -1;
 	for (a = r; a != NULL; a = a->ai_next) {
 		if ((f = socket(a->ai_family, a->ai_socktype, a->ai_protocol)) < 0)