From 5ea460a32a9882906c7ee3656b8fb0dcdbce2abc Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Mon, 1 Jun 2020 08:46:17 +0100 Subject: win32: only initialise networking if necessary A call to initialise networking is made during start up even if the applet doesn't need it. Instead, only initialise networking when a call is made to a function that definitely requires it. --- include/mingw.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/mingw.h b/include/mingw.h index 26f0688d7..fa8f705b0 100644 --- a/include/mingw.h +++ b/include/mingw.h @@ -229,6 +229,10 @@ int mingw_accept(int sockfd1, struct sockaddr *sa, socklen_t *sz); int mingw_select (int nfds, fd_set *rfds, fd_set *wfds, fd_set *xfds, struct timeval *timeout); int mingw_getpeername(int fd, struct sockaddr *sa, socklen_t *sz); +int mingw_gethostname(char *host, int namelen); +int mingw_getaddrinfo(const char *node, const char *service, + const struct addrinfo *hints, struct addrinfo **res); +struct hostent *mingw_gethostbyaddr(const void *addr, socklen_t len, int type); NOIMPL(mingw_sendto,SOCKET s UNUSED_PARAM, const char *buf UNUSED_PARAM, int len UNUSED_PARAM, int flags UNUSED_PARAM, const struct sockaddr *sa UNUSED_PARAM, int salen UNUSED_PARAM); @@ -242,6 +246,9 @@ NOIMPL(mingw_sendto,SOCKET s UNUSED_PARAM, const char *buf UNUSED_PARAM, int len #define accept mingw_accept #define select mingw_select #define getpeername mingw_getpeername +#define gethostname mingw_gethostname +#define getaddrinfo mingw_getaddrinfo +#define gethostbyaddr mingw_gethostbyaddr /* * sys/time.h @@ -502,7 +509,6 @@ void qsort_string_vector_case(char **sv, unsigned count) FAST_FUNC; */ const char *get_busybox_exec_path(void); -void init_winsock(void); void init_codepage(void); int has_bat_suffix(const char *p); -- cgit v1.2.3-55-g6feb