Просмотр исходного кода

os400: use platform socklen_t in Curl_getnameinfo_a

Curl_getnameinfo_a() is prototyped before including curl.h as an
ASCII'fied wrapper for getnameinfo(), which itself is prototyped with
socklen_t arguments, so this should use the platform socklen_t and not
curl_socklen_t too.

Update setup-os400.h

Fixes #9811
Closes #9812
jonrumsey 2 лет назад
Родитель
Сommit
a3063fe014
2 измененных файлов с 7 добавлено и 7 удалено
  1. 4 4
      lib/setup-os400.h
  2. 3 3
      packages/OS400/os400sys.c

+ 4 - 4
lib/setup-os400.h

@@ -49,11 +49,11 @@ extern int Curl_getaddrinfo_a(const char *nodename,
                               struct addrinfo **res);
 #define getaddrinfo             Curl_getaddrinfo_a
 
-
+/* Note socklen_t must be used as this is declared before curl_socklen_t */
 extern int Curl_getnameinfo_a(const struct sockaddr *sa,
-                              curl_socklen_t salen,
-                              char *nodename, curl_socklen_t nodenamelen,
-                              char *servname, curl_socklen_t servnamelen,
+                              socklen_t salen,
+                              char *nodename, socklen_t nodenamelen,
+                              char *servname, socklen_t servnamelen,
                               int flags);
 #define getnameinfo             Curl_getnameinfo_a
 

+ 3 - 3
packages/OS400/os400sys.c

@@ -255,9 +255,9 @@ set_thread_string(localkey_t key, const char *s)
 
 
 int
-Curl_getnameinfo_a(const struct sockaddr *sa, curl_socklen_t salen,
-                   char *nodename, curl_socklen_t nodenamelen,
-                   char *servname, curl_socklen_t servnamelen,
+Curl_getnameinfo_a(const struct sockaddr *sa, socklen_t salen,
+                   char *nodename, socklen_t nodenamelen,
+                   char *servname, socklen_t servnamelen,
                    int flags)
 {
   char *enodename = NULL;