aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2005-09-21 14:43:11 +0000
committerMatthias Andree <matthias.andree@gmx.de>2005-09-21 14:43:11 +0000
commit47b40b940159a43557286fdb5ab0db74d4dcc93e (patch)
treede0c7ad44e5a425ea136ffb483554a45c8214c8c
parent72db7561e149886e5161d8759aca7122c5d36c72 (diff)
downloadfetchmail-47b40b940159a43557286fdb5ab0db74d4dcc93e.tar.gz
fetchmail-47b40b940159a43557286fdb5ab0db74d4dcc93e.tar.bz2
fetchmail-47b40b940159a43557286fdb5ab0db74d4dcc93e.zip
When getaddrinfo() fails resolving a service, log getaddrinfo() error.
svn path=/trunk/; revision=4310
-rw-r--r--NEWS1
-rw-r--r--servport.c7
2 files changed, 6 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 9a5ea405..cfb89a37 100644
--- a/NEWS
+++ b/NEWS
@@ -205,6 +205,7 @@ fetchmail 6.3.0 (not yet released officially):
* Add full support for --service option. Matthias Andree
* Fix Japanese translation of "no other fetchmail is running". Debian
Bug#329342, Takeshi Hamasaki. (MA)
+* When getaddrinfo() fails resolving a service, log getaddrinfo() error. (MA)
# INTERNAL CHANGES
* Switched to automake. Matthias Andree.
diff --git a/servport.c b/servport.c
index 171eb53f..4d0fe510 100644
--- a/servport.c
+++ b/servport.c
@@ -23,7 +23,7 @@
#include <sys/socket.h>
int servport(const char *service) {
- int port;
+ int port, e;
unsigned long u;
char *end;
@@ -47,7 +47,10 @@ int servport(const char *service) {
memset(&hints, 0, sizeof hints);
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
- if (getaddrinfo(NULL, service, &hints, &res)) {
+ e = getaddrinfo(NULL, service, &hints, &res);
+ if (e) {
+ report(stderr, GT_("getaddrinfo(NULL, \"%s\") error: %s\n"),
+ service, gai_strerror(e));
goto err;
} else {
switch(res->ai_addr->sa_family) {