... | ... |
@@ -1,3 +1,7 @@ |
1 |
+Mon May 10 14:11:51 CEST 2010 (acab) |
|
2 |
+------------------------------------ |
|
3 |
+ * win32: simulate gai_strerror |
|
4 |
+ |
|
1 | 5 |
Mon May 10 03:43:43 CEST 2010 (acab) |
2 | 6 |
------------------------------------ |
3 | 7 |
* libclamav: Use mpool in win32 (well, sort of) as the mighty crt allocator |
... | ... |
@@ -113,7 +113,7 @@ int notify(const char *cfgfile) |
113 | 113 |
ret = getaddrinfo(addr, port, &hints, &res); |
114 | 114 |
|
115 | 115 |
if(ret) { |
116 |
- /* logg("^Clamd was NOT notified: Can't resolve hostname %s (%s)\n", addr ? addr : "", (ret == EAI_SYSTEM) ? strerror(errno) : gai_strerror(ret)); */ |
|
116 |
+ logg("^Clamd was NOT notified: Can't resolve hostname %s (%s)\n", addr ? addr : "", (ret == EAI_SYSTEM) ? strerror(errno) : gai_strerror(ret)); |
|
117 | 117 |
optfree(opts); |
118 | 118 |
return 1; |
119 | 119 |
} |
... | ... |
@@ -286,7 +286,9 @@ struct servent *w32_getservbyname(const char *name, const char *proto) { |
286 | 286 |
} |
287 | 287 |
|
288 | 288 |
int w32_getaddrinfo(const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res) { |
289 |
- return getaddrinfo(node, service, hints, res); |
|
289 |
+ int ret = getaddrinfo(node, service, hints, res); |
|
290 |
+ if(ret) wsock2errno(); |
|
291 |
+ return ret; |
|
290 | 292 |
} |
291 | 293 |
|
292 | 294 |
void w32_freeaddrinfo(struct addrinfo *res) { |
... | ... |
@@ -53,6 +53,7 @@ char *strptime(const char *s, const char *format, struct tm *tm); |
53 | 53 |
#define closesocket w32_closesocket |
54 | 54 |
#define getservbyname w32_getservbyname |
55 | 55 |
#define getaddrinfo w32_getaddrinfo |
56 |
+#define gai_strerror w32_strerror |
|
56 | 57 |
#define freeaddrinfo w32_freeaddrinfo |
57 | 58 |
#define inet_ntop w32_inet_ntop |
58 | 59 |
#define gethostbyname w32_gethostbyname |
... | ... |
@@ -64,8 +65,9 @@ char *strptime(const char *s, const char *format, struct tm *tm); |
64 | 64 |
#define getpid GetCurrentProcessId |
65 | 65 |
|
66 | 66 |
#define PATH_MAX 32767 |
67 |
- |
|
68 | 67 |
#define SEARCH_LIBDIR "" |
68 |
+#define WORDS_BIGENDIAN 0 |
|
69 |
+#define EAI_SYSTEM 0 |
|
69 | 70 |
|
70 | 71 |
#ifndef MIN |
71 | 72 |
#define MIN(a, b) (((a) < (b)) ? (a) : (b)) |
... | ... |
@@ -108,4 +110,4 @@ int real_main(int, char**); |
108 | 108 |
#define main main(int argc, char **argv) { _setmode(_fileno(stdin), _O_BINARY); w32_glob(&argc, &argv); return real_main(argc, argv); }; int real_main |
109 | 109 |
|
110 | 110 |
#endif /* __PLATFORM_H */ |
111 |
-#define WORDS_BIGENDIAN 0 |
|
111 |
+ |