Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorYaakov Selkowitz <yselkowi at redhat dot com>2017-09-27 04:36:35 +0300
committerYaakov Selkowitz <yselkowi@redhat.com>2017-10-10 21:51:23 +0300
commit747f31854a572b3dd64912997dde2dc984b1f2d8 (patch)
tree6358d38ed94563513e0b234d69f4da88c488dfa5 /winsup
parent0b45b053e833d2e87dd71a4a5198fd8158d53a1d (diff)
cygwin: fix gethostbyaddr argument types
The first argument of gethostbyaddr needs to accept a generic pointer to be compatible with e.g. struct in_addr *. This caused an issue compiling krb5-1.15. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/include/netdb.h2
-rw-r--r--winsup/cygwin/net.cc4
2 files changed, 3 insertions, 3 deletions
diff --git a/winsup/cygwin/include/netdb.h b/winsup/cygwin/include/netdb.h
index e46e34169..91e91720d 100644
--- a/winsup/cygwin/include/netdb.h
+++ b/winsup/cygwin/include/netdb.h
@@ -228,7 +228,7 @@ void endnetent (void);
void endprotoent (void);
void endservent (void);
void endrpcent (void);
-struct hostent *gethostbyaddr (const char *, int, int);
+struct hostent *gethostbyaddr (const void *, socklen_t, int);
struct hostent *gethostbyname (const char *);
#if __MISC_VISIBLE
struct hostent *gethostbyname2 (const char *, int);
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index fd903b112..8969e7c6f 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -1152,13 +1152,13 @@ cygwin_gethostbyname (const char *name)
/* exported as gethostbyaddr: standards? */
extern "C" struct hostent *
-cygwin_gethostbyaddr (const char *addr, int len, int type)
+cygwin_gethostbyaddr (const void *addr, socklen_t len, int type)
{
hostent *res = NULL;
__try
{
- res = dup_ent (gethostbyaddr (addr, len, type));
+ res = dup_ent (gethostbyaddr ((const char *) addr, len, type));
if (res)
debug_printf ("h_name %s", res->h_name);
else