summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2011-03-03 21:05:28 +0000
committerVincent Torri <vincent.torri@gmail.com>2011-03-03 21:05:28 +0000
commitf2247fb7e367bc3f586c5afb7ec8118c86a3d8b5 (patch)
tree26642176337afe5356e5b0bf04a94f474cdf18e0
parente625aefa080849de190a9cff3b784e26b46e3d19 (diff)
Ecore ecore_con:
* include arpa/inet.h if it is detected * use correct types * small cleanup SVN revision: 57503
-rw-r--r--legacy/ecore/src/lib/ecore_con/ecore_con.c11
-rw-r--r--legacy/ecore/src/lib/ecore_con/ecore_con_ares.c10
2 files changed, 12 insertions, 9 deletions
diff --git a/legacy/ecore/src/lib/ecore_con/ecore_con.c b/legacy/ecore/src/lib/ecore_con/ecore_con.c
index dbf1039465..31315519e7 100644
--- a/legacy/ecore/src/lib/ecore_con/ecore_con.c
+++ b/legacy/ecore/src/lib/ecore_con/ecore_con.c
@@ -381,7 +381,7 @@ error:
381 if (svr->path) 381 if (svr->path)
382 free(svr->path); 382 free(svr->path);
383 383
384#ifndef _WIN32 384
385 if (svr->fd_handler) 385 if (svr->fd_handler)
386 ecore_main_fd_handler_del(svr->fd_handler); 386 ecore_main_fd_handler_del(svr->fd_handler);
387 387
@@ -394,7 +394,6 @@ error:
394 if (svr->ip) 394 if (svr->ip)
395 eina_stringshare_del(svr->ip); 395 eina_stringshare_del(svr->ip);
396 396
397#endif
398 ecore_con_ssl_server_shutdown(svr); 397 ecore_con_ssl_server_shutdown(svr);
399 free(svr); 398 free(svr);
400 return NULL; 399 return NULL;
@@ -1852,7 +1851,7 @@ svr_try_connect_plain(Ecore_Con_Server *svr)
1852{ 1851{
1853 int res; 1852 int res;
1854 int so_err = 0; 1853 int so_err = 0;
1855 unsigned int size = sizeof(int); 1854 socklen_t size = sizeof(int);
1856 1855
1857 res = getsockopt(svr->fd, SOL_SOCKET, SO_ERROR, (void *)&so_err, &size); 1856 res = getsockopt(svr->fd, SOL_SOCKET, SO_ERROR, (void *)&so_err, &size);
1858#ifdef _WIN32 1857#ifdef _WIN32
@@ -2161,14 +2160,14 @@ _ecore_con_svr_udp_handler(void *data,
2161{ 2160{
2162 unsigned char buf[READBUFSIZ]; 2161 unsigned char buf[READBUFSIZ];
2163 unsigned char client_addr[256]; 2162 unsigned char client_addr[256];
2164 unsigned int client_addr_len = sizeof(client_addr); 2163 socklen_t client_addr_len = sizeof(client_addr);
2165 int num; 2164 int num;
2166 Ecore_Con_Server *svr; 2165 Ecore_Con_Server *svr;
2167 Ecore_Con_Client *cl = NULL; 2166 Ecore_Con_Client *cl = NULL;
2168 2167
2169 svr = data; 2168 svr = data;
2170 2169
2171 if (svr->delete_me || svr->dead) 2170 if (svr->delete_me || svr->dead)
2172 return ECORE_CALLBACK_RENEW; 2171 return ECORE_CALLBACK_RENEW;
2173 2172
2174 if (ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_WRITE)) 2173 if (ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_WRITE))
@@ -2183,7 +2182,7 @@ _ecore_con_svr_udp_handler(void *data,
2183#ifdef _WIN32 2182#ifdef _WIN32
2184 num = fcntl(svr->fd, F_SETFL, O_NONBLOCK); 2183 num = fcntl(svr->fd, F_SETFL, O_NONBLOCK);
2185 if (num >= 0) 2184 if (num >= 0)
2186 num = recvfrom(svr->fd, buf, sizeof(buf), 0, 2185 num = recvfrom(svr->fd, (char *)buf, sizeof(buf), 0,
2187 (struct sockaddr *)&client_addr, 2186 (struct sockaddr *)&client_addr,
2188 &client_addr_len); 2187 &client_addr_len);
2189 2188
diff --git a/legacy/ecore/src/lib/ecore_con/ecore_con_ares.c b/legacy/ecore/src/lib/ecore_con/ecore_con_ares.c
index ea8ec82b12..5800c677be 100644
--- a/legacy/ecore/src/lib/ecore_con/ecore_con_ares.c
+++ b/legacy/ecore/src/lib/ecore_con/ecore_con_ares.c
@@ -10,7 +10,11 @@
10 */ 10 */
11 11
12#include <string.h> 12#include <string.h>
13#include <arpa/inet.h> 13
14#ifdef HAVE_ARPA_INET_H
15# include <arpa/inet.h>
16#endif
17
14#include <ares.h> 18#include <ares.h>
15 19
16#include "Ecore.h" 20#include "Ecore.h"
@@ -63,7 +67,7 @@ static Eina_Bool _ecore_con_info_cares_timeout_cb(void *data);
63 67
64static void 68static void
65_ecore_con_info_cares_state_cb(void *data, 69_ecore_con_info_cares_state_cb(void *data,
66 int fd, 70 ares_socket_t fd,
67 int read, 71 int read,
68 int write); 72 int write);
69static int 73static int
@@ -347,7 +351,7 @@ _ecore_con_info_fds_search(const Ecore_Con_FD *fd1,
347 351
348static void 352static void
349_ecore_con_info_cares_state_cb(void *data __UNUSED__, 353_ecore_con_info_cares_state_cb(void *data __UNUSED__,
350 int fd, 354 ares_socket_t fd,
351 int read, 355 int read,
352 int write) 356 int write)
353{ 357{