summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2016-12-19 12:47:13 -0200
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2016-12-19 13:03:33 -0200
commitb4c80b50bcef841d853f7e884b3eb921466096f3 (patch)
treeab71deb94cc351d6eaa5349886d34bdfa7781e65 /src
parentae054e6c0bb5cab6ca126c152057e5243ab31dfa (diff)
efl_net_socket_fd: initialize fds to INVALID_SOCKET
Since 0 is a valid fd, then we'd try to do socket operations on it, which would generate misleading errors.
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore_con/efl_net_socket_fd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/ecore_con/efl_net_socket_fd.c b/src/lib/ecore_con/efl_net_socket_fd.c
index ec0134f0b6..6902c87cbc 100644
--- a/src/lib/ecore_con/efl_net_socket_fd.c
+++ b/src/lib/ecore_con/efl_net_socket_fd.c
@@ -79,6 +79,9 @@ _efl_net_socket_fd_efl_object_constructor(Eo *o, Efl_Net_Socket_Fd_Data *pd)
79 79
80 efl_io_closer_close_on_exec_set(o, EINA_TRUE); 80 efl_io_closer_close_on_exec_set(o, EINA_TRUE);
81 efl_io_closer_close_on_destructor_set(o, EINA_TRUE); 81 efl_io_closer_close_on_destructor_set(o, EINA_TRUE);
82 efl_io_reader_fd_set(o, SOCKET_TO_LOOP_FD(INVALID_SOCKET));
83 efl_io_writer_fd_set(o, SOCKET_TO_LOOP_FD(INVALID_SOCKET));
84 efl_io_closer_fd_set(o, SOCKET_TO_LOOP_FD(INVALID_SOCKET));
82 85
83 return o; 86 return o;
84} 87}
@@ -175,8 +178,9 @@ _efl_net_socket_fd_efl_io_closer_close(Eo *o, Efl_Net_Socket_Fd_Data *pd EINA_UN
175} 178}
176 179
177EOLIAN static Eina_Bool 180EOLIAN static Eina_Bool
178_efl_net_socket_fd_efl_io_closer_closed_get(Eo *o, Efl_Net_Socket_Fd_Data *pd EINA_UNUSED) 181_efl_net_socket_fd_efl_io_closer_closed_get(Eo *o, Efl_Net_Socket_Fd_Data *pd)
179{ 182{
183 if (pd->family == AF_UNSPEC) return EINA_FALSE;
180 return (SOCKET)efl_io_closer_fd_get(o) == INVALID_SOCKET; 184 return (SOCKET)efl_io_closer_fd_get(o) == INVALID_SOCKET;
181} 185}
182 186