Get the 'fd' from the handler First (regardless of read or write) so

that it can be used in the below event callback.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2013-08-06 09:47:08 +01:00
parent 6583b83c73
commit 5be999e0f5
1 changed files with 3 additions and 4 deletions

View File

@ -47,14 +47,13 @@ _ecore_io_wrapper(void *data, Ecore_Fd_Handler *handler)
pa_io_event *event = (pa_io_event *)data;
int fd = 0;
fd = ecore_main_fd_handler_fd_get(handler);
if (fd < 0) return ECORE_CALLBACK_RENEW;
if (ecore_main_fd_handler_active_get(handler, ECORE_FD_READ))
{
flags |= PA_IO_EVENT_INPUT;
fd = ecore_main_fd_handler_fd_get(handler);
if (fd < 0) return ECORE_CALLBACK_RENEW;
/* Check for HUP and report */
if (recv(fd, buf, 64, MSG_PEEK))
{