devilhorns pushed a commit to branch master.
commit 76766161d2761d82bac085f2746dcb3f2d9ff056
Author: Chris Michael <[email protected]>
Date: Mon Aug 5 11:46:04 2013 +0100
ecore_main_fd_handler_fd_get can return -1 so we need to check for a
valid fd before calling read().
Reuse returned fd variable in the callback to save extra function call
to ecore_main_fd_handler_fd_get (since we already acquired the fd
above).
Signed-off-by: Chris Michael <[email protected]>
---
src/lib/ecore_audio/ecore_audio_pulse_ml.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/lib/ecore_audio/ecore_audio_pulse_ml.c
b/src/lib/ecore_audio/ecore_audio_pulse_ml.c
index b9ce552..ce41c7e 100644
--- a/src/lib/ecore_audio/ecore_audio_pulse_ml.c
+++ b/src/lib/ecore_audio/ecore_audio_pulse_ml.c
@@ -48,10 +48,15 @@ _ecore_io_wrapper(void *data, Ecore_Fd_Handler *handler)
if (ecore_main_fd_handler_active_get(handler, ECORE_FD_READ))
{
+ int fd;
+
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(ecore_main_fd_handler_fd_get(handler), buf, 64, MSG_PEEK))
+ if (recv(fd, buf, 64, MSG_PEEK))
{
if (errno == ESHUTDOWN || errno == ECONNRESET || errno ==
ECONNABORTED || errno == ENETRESET)
{
@@ -66,7 +71,7 @@ _ecore_io_wrapper(void *data, Ecore_Fd_Handler *handler)
if (ecore_main_fd_handler_active_get(handler, ECORE_FD_ERROR))
flags |= PA_IO_EVENT_ERROR;
- event->callback(event->mainloop, event,
ecore_main_fd_handler_fd_get(handler), flags, event->userdata);
+ event->callback(event->mainloop, event, fd, flags, event->userdata);
return ECORE_CALLBACK_RENEW;
}
--
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk