summaryrefslogtreecommitdiff
path: root/src/lib/ecore
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-08-11 18:43:15 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-08-11 18:43:13 -0400
commitc03ea430ab0af5ca2c3bee97756317c4f0be22d8 (patch)
treef814c15c5e4378ae9efd59d1717e027f7359b52c /src/lib/ecore
parent302237fa77b37dbd9e40aeef5760a03a2c30dd83 (diff)
ecore: always set delete_me before removing fd from poll
ensure bad fds don't immediately get re-added to polling @fix
Diffstat (limited to 'src/lib/ecore')
-rw-r--r--src/lib/ecore/ecore_main.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c
index 4bf3dc546d..8ca2c96293 100644
--- a/src/lib/ecore/ecore_main.c
+++ b/src/lib/ecore/ecore_main.c
@@ -1222,8 +1222,8 @@ _ecore_main_fd_handler_del(Ecore_Fd_Handler *fd_handler)
1222 return NULL; 1222 return NULL;
1223 } 1223 }
1224 1224
1225 _ecore_main_fdh_poll_del(fd_handler);
1226 fd_handler->delete_me = EINA_TRUE; 1225 fd_handler->delete_me = EINA_TRUE;
1226 _ecore_main_fdh_poll_del(fd_handler);
1227 fd_handlers_to_delete = eina_list_append(fd_handlers_to_delete, fd_handler); 1227 fd_handlers_to_delete = eina_list_append(fd_handlers_to_delete, fd_handler);
1228 if (fd_handler->prep_func && fd_handlers_with_prep) 1228 if (fd_handler->prep_func && fd_handlers_with_prep)
1229 fd_handlers_with_prep = eina_list_remove(fd_handlers_with_prep, fd_handler); 1229 fd_handlers_with_prep = eina_list_remove(fd_handlers_with_prep, fd_handler);
@@ -1882,8 +1882,8 @@ _ecore_main_fd_handlers_bads_rem(void)
1882 ERR("Fd function err returned 0, remove it"); 1882 ERR("Fd function err returned 0, remove it");
1883 if (!fdh->delete_me) 1883 if (!fdh->delete_me)
1884 { 1884 {
1885 _ecore_main_fdh_poll_del(fdh);
1886 fdh->delete_me = EINA_TRUE; 1885 fdh->delete_me = EINA_TRUE;
1886 _ecore_main_fdh_poll_del(fdh);
1887 fd_handlers_to_delete = eina_list_append(fd_handlers_to_delete, fdh); 1887 fd_handlers_to_delete = eina_list_append(fd_handlers_to_delete, fdh);
1888 } 1888 }
1889 found++; 1889 found++;
@@ -1895,8 +1895,8 @@ _ecore_main_fd_handlers_bads_rem(void)
1895 ERR("Problematic fd found at %d! setting it for delete", fdh->fd); 1895 ERR("Problematic fd found at %d! setting it for delete", fdh->fd);
1896 if (!fdh->delete_me) 1896 if (!fdh->delete_me)
1897 { 1897 {
1898 _ecore_main_fdh_poll_del(fdh);
1899 fdh->delete_me = EINA_TRUE; 1898 fdh->delete_me = EINA_TRUE;
1899 _ecore_main_fdh_poll_del(fdh);
1900 fd_handlers_to_delete = eina_list_append(fd_handlers_to_delete, fdh); 1900 fd_handlers_to_delete = eina_list_append(fd_handlers_to_delete, fdh);
1901 } 1901 }
1902 1902
@@ -2006,8 +2006,8 @@ _ecore_main_fd_handlers_call(void)
2006 { 2006 {
2007 if (!fdh->delete_me) 2007 if (!fdh->delete_me)
2008 { 2008 {
2009 _ecore_main_fdh_poll_del(fdh);
2010 fdh->delete_me = EINA_TRUE; 2009 fdh->delete_me = EINA_TRUE;
2010 _ecore_main_fdh_poll_del(fdh);
2011 fd_handlers_to_delete = eina_list_append(fd_handlers_to_delete, fdh); 2011 fd_handlers_to_delete = eina_list_append(fd_handlers_to_delete, fdh);
2012 } 2012 }
2013 } 2013 }
@@ -2087,6 +2087,7 @@ _ecore_main_loop_uv_prepare(uv_prepare_t* handle EINA_UNUSED)
2087 fdh = fd_handlers; 2087 fdh = fd_handlers;
2088 fd_handlers = (Ecore_Fd_Handler *)eina_inlist_remove(EINA_INLIST_GET(fd_handlers), 2088 fd_handlers = (Ecore_Fd_Handler *)eina_inlist_remove(EINA_INLIST_GET(fd_handlers),
2089 EINA_INLIST_GET(fdh)); 2089 EINA_INLIST_GET(fdh));
2090 fdh->delete_me = 1;
2090 _ecore_main_fdh_poll_del(fdh); 2091 _ecore_main_fdh_poll_del(fdh);
2091 ECORE_MAGIC_SET(fdh, ECORE_MAGIC_NONE); 2092 ECORE_MAGIC_SET(fdh, ECORE_MAGIC_NONE);
2092 ecore_fd_handler_mp_free(fdh); 2093 ecore_fd_handler_mp_free(fdh);