this adds a small helper function for use in finding cases where the epoll fd gets...
authordiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 1 Jan 2011 03:07:58 +0000 (03:07 +0000)
committerdiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 1 Jan 2011 03:07:58 +0000 (03:07 +0000)
if epoll support is not enabled, the function does nothing
this will be removed prior to actual release, but will be very useful in finding the last epoll bugs until then

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@55791 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore/ecore_main.c
src/lib/ecore/ecore_private.h

index 6f7bf7e..5fa9b2f 100644 (file)
@@ -154,6 +154,18 @@ static gboolean ecore_idling;
 static gboolean ecore_fds_ready;
 #endif
 
+void
+_ecore_fd_valid(void)
+{
+#ifdef HAVE_EPOLL
+   if (fcntl(epoll_fd, F_GETFD) < 0)
+     {
+        ERR("arghhh you caught me! report a backtrace to edevel!");
+        sleep(5);
+     }
+#endif
+}
+
 #ifdef HAVE_EPOLL
 static inline int
 _ecore_get_epoll_fd(void)
@@ -1307,6 +1319,7 @@ _ecore_main_fd_handlers_call(void)
 
                     }
                   fdh->references--;
+                  _ecore_fd_valid();
 
                   fdh->read_active = EINA_FALSE;
                   fdh->write_active = EINA_FALSE;
index 00ab920..7e2afa0 100644 (file)
@@ -118,6 +118,7 @@ typedef unsigned int              Ecore_Magic;
 EAPI void          _ecore_magic_fail(const void *d, Ecore_Magic m, Ecore_Magic req_m, const char *fname);
 
 void          _ecore_time_init(void);
+void          _ecore_fd_valid(void);
 
 void          _ecore_timer_shutdown(void);
 void          _ecore_timer_cleanup(void);