devilhorns pushed a commit to branch master.
commit 8270fc29f3964f96d7029d5c3dcebe5be8bb5bff
Author: Chris Michael <[email protected]>
Date: Mon Aug 5 11:24:11 2013 +0100
ecore_main_fd_handler_fd_get can return -1 so check fd validity before
calling read() with potentially -1.
Signed-off-by: Chris Michael <[email protected]>
---
src/lib/eio/eio_monitor_inotify.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/lib/eio/eio_monitor_inotify.c
b/src/lib/eio/eio_monitor_inotify.c
index 6fb6b08..5ad5e79 100644
--- a/src/lib/eio/eio_monitor_inotify.c
+++ b/src/lib/eio/eio_monitor_inotify.c
@@ -123,11 +123,14 @@ _eio_inotify_handler(void *data EINA_UNUSED,
Ecore_Fd_Handler *fdh)
Eio_Monitor_Backend *backend;
unsigned char buffer[16384];
struct inotify_event *event;
- int i = 0;
+ int i = 0, fd;
int event_size;
ssize_t size;
- size = read(ecore_main_fd_handler_fd_get(fdh), buffer, sizeof(buffer));
+ fd = ecore_main_fd_handler_fd_get(fdh);
+ if (fd < 0) return ECORE_CALLBACK_RENEW;
+
+ size = read(fd, buffer, sizeof(buffer));
while (i < size)
{
event = (struct inotify_event *)&buffer[i];
--
------------------------------------------------------------------------------
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