This is the mail archive of the cygwin-cvs@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin] cygwin: fix gethostbyaddr argument types


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=747f31854a572b3dd64912997dde2dc984b1f2d8

commit 747f31854a572b3dd64912997dde2dc984b1f2d8
Author: Yaakov Selkowitz <yselkowi at redhat dot com>
Date:   Tue Sep 26 20:36:35 2017 -0500

    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>

Diff:
---
 winsup/cygwin/include/netdb.h | 2 +-
 winsup/cygwin/net.cc          | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/winsup/cygwin/include/netdb.h b/winsup/cygwin/include/netdb.h
index e46e341..91e9172 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 fd903b1..8969e7c 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]