diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1998-11-05 06:34:58 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1998-11-05 06:34:58 +0000 |
commit | a39c16655a2d05c7981211352e33d7159758c4f7 (patch) | |
tree | 31e5476cf949b16f33f629edb93b2df06d8f27c0 /driver.c | |
parent | 1623a1127d9502e717694b6068fd21e7f79f6511 (diff) | |
download | fetchmail-a39c16655a2d05c7981211352e33d7159758c4f7.tar.gz fetchmail-a39c16655a2d05c7981211352e33d7159758c4f7.tar.bz2 fetchmail-a39c16655a2d05c7981211352e33d7159758c4f7.zip |
Dave Bodenstab's fix.
svn path=/trunk/; revision=2174
Diffstat (limited to 'driver.c')
-rw-r--r-- | driver.c | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -1397,10 +1397,19 @@ const struct method *proto; /* protocol method table */ #endif /* INET6 */ { #if !INET6 + int err_no = errno; #ifdef HAVE_RES_SEARCH - if (errno != 0 && h_errno != 0) + if (err_no != 0 && h_errno != 0) error(0, 0, "fetchmail: internal inconsistency"); #endif + /* + * Avoid generating a bogus error every poll cycle when we're + * in daemon mode but the connection to the outside world + * is down. + */ + if (err_no == EHOSTUNREACH && run.poll_interval) + goto ehostunreach; + error_build("fetchmail: %s connection to %s failed", protocol->name, ctl->server.pollname); #ifdef HAVE_RES_SEARCH @@ -1417,10 +1426,12 @@ const struct method *proto; /* protocol method table */ else error_complete(0, 0, ": unknown DNS error %d", h_errno); } + else #endif /* HAVE_RES_SEARCH */ - if (errno != 0) - error_complete(0, errno, ""); + error_complete(0, err_no, ""); + + ehostunreach: #endif /* INET6 */ ok = PS_SOCKET; set_timeout(0); @@ -1485,7 +1496,7 @@ const struct method *proto; /* protocol method table */ * calling user a heads-up about the authentication * failure the first time it happens. */ - if (run.poll_interval && !nodetach + if (run.poll_interval && !ctl->authfailcount && !open_warning_by_mail(ctl)) { stuff_warning_line(ctl, |