stefan pushed a commit to branch master.
commit d2f8eaf6c89d65cd958c96910eea8befe63333dc
Author: Stefan Schmidt <[email protected]>
Date: Wed Aug 7 15:05:34 2013 +0100
eio: Check return code of fcntl()
CID 1039686
---
src/lib/eio/eio_monitor_inotify.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/lib/eio/eio_monitor_inotify.c
b/src/lib/eio/eio_monitor_inotify.c
index 5ad5e79..0826845 100644
--- a/src/lib/eio/eio_monitor_inotify.c
+++ b/src/lib/eio/eio_monitor_inotify.c
@@ -168,7 +168,7 @@ void eio_monitor_backend_init(void)
{
int fd;
#ifdef HAVE_FCNTL
- int flags;
+ int flags, rc;
#endif
fd = inotify_init();
@@ -178,7 +178,9 @@ void eio_monitor_backend_init(void)
#ifdef HAVE_FCNTL
flags = fcntl(fd, F_GETFD);
flags |= FD_CLOEXEC;
- fcntl(fd, F_SETFD, flags);
+ rc = fcntl(fd, F_SETFD, flags);
+ if (rc < 0)
+ return;
#endif
_inotify_fdh = ecore_main_fd_handler_add(fd, ECORE_FD_READ,
_eio_inotify_handler, NULL, NULL, NULL);
--
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk