diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2001-05-19 20:38:39 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2001-05-19 20:38:39 +0800 |
commit | e2edef6e5e7546ce591f2318bce9d115a223d78d (patch) | |
tree | 6ae1f364ec4b7c47c6d10beb0533c7d4bcf1b1f4 /e-util/e-host-utils.c | |
parent | 040905c9a295fee00e98260175559f54bc6c6110 (diff) | |
download | gsoc2013-evolution-e2edef6e5e7546ce591f2318bce9d115a223d78d.tar gsoc2013-evolution-e2edef6e5e7546ce591f2318bce9d115a223d78d.tar.gz gsoc2013-evolution-e2edef6e5e7546ce591f2318bce9d115a223d78d.tar.bz2 gsoc2013-evolution-e2edef6e5e7546ce591f2318bce9d115a223d78d.tar.lz gsoc2013-evolution-e2edef6e5e7546ce591f2318bce9d115a223d78d.tar.xz gsoc2013-evolution-e2edef6e5e7546ce591f2318bce9d115a223d78d.tar.zst gsoc2013-evolution-e2edef6e5e7546ce591f2318bce9d115a223d78d.zip |
Modify `e_gethostbyname_r()' so that it doesn't report an error if the
5-argument `gethostbyname_r()' returns a non-NULL hostent and a
nonzero herr.
This fixes the "Cannot resolve localhost" error on GNU/Linux with libc
2.2.x.
svn path=/trunk/; revision=9888
Diffstat (limited to 'e-util/e-host-utils.c')
-rw-r--r-- | e-util/e-host-utils.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/e-util/e-host-utils.c b/e-util/e-host-utils.c index d20261e5a6..108a732b83 100644 --- a/e-util/e-host-utils.c +++ b/e-util/e-host-utils.c @@ -57,7 +57,12 @@ e_gethostbyname_r (const char *name, struct hostent *host, return errno; #else struct hostent *hp; - return gethostbyname_r(name, host, buf, buflen, &hp, herr); + int retval; + + retval = gethostbyname_r(name, host, buf, buflen, &hp, herr); + if (hp != NULL) + *herr = 0; + return retval; #endif #else int i; |