POSIX does not require it, the companion getaddrinfo implementation
does not do it, and this behavior is not documented in the manual
page, either.
(cherry picked from commit
2b54cbce2c363ab6ae89d10657d7465858116d7a)
+2016-04-28 Florian Weimer <fweimer@redhat.com>
+
+ * inet/getnameinfo.c (getnameinfo): Do not preserve errno.
+
2016-03-29 Florian Weimer <fweimer@redhat.com>
[BZ #19837]
socklen_t hostlen, char *serv, socklen_t servlen,
int flags)
{
- int serrno = errno;
int herrno;
struct hostent th;
int ok = 0;
if (!ok)
{
if (flags & NI_NAMEREQD)
- {
- __set_errno (serrno);
- return EAI_NONAME;
- }
+ return EAI_NONAME;
else
{
const char *c;
};
if (flags & NI_NAMEREQD)
- {
- __set_errno (serrno);
- return EAI_NONAME;
- }
+ return EAI_NONAME;
strncpy (host, "localhost", hostlen);
break;
host[hostlen-1] = 0;
if (serv && (servlen > 0))
serv[servlen-1] = 0;
- errno = serrno;
return 0;
}
libc_hidden_def (getnameinfo)