osaf/libs/agents/saf/eda/eda_mds.c     |  10 +++-------
 osaf/libs/agents/saf/eda/eda_saf_api.c |   2 +-
 2 files changed, 4 insertions(+), 8 deletions(-)


The select() function cannot handle file descriptors larger than 1023. To avoid
this limitation, we replace all usages of select() with poll().

diff --git a/osaf/libs/agents/saf/eda/eda_mds.c 
b/osaf/libs/agents/saf/eda/eda_mds.c
--- a/osaf/libs/agents/saf/eda/eda_mds.c
+++ b/osaf/libs/agents/saf/eda/eda_mds.c
@@ -15,7 +15,8 @@
  *
  */
 
-#include <logtrace.h>
+#include "logtrace.h"
+#include "osaf_poll.h"
 
 #include "eda.h"
 
@@ -1520,9 +1521,6 @@ uint32_t eda_mds_init(EDA_CB *cb)
 **********************************************************************/
 void eda_sync_with_eds(EDA_CB *cb)
 {
-       NCS_SEL_OBJ_SET set;
-       uint32_t timeout = 3000;
-
        m_NCS_LOCK(&cb->eds_sync_lock, NCS_LOCK_WRITE);
 
        if (cb->eds_intf.eds_up) {
@@ -1535,9 +1533,7 @@ void eda_sync_with_eds(EDA_CB *cb)
        m_NCS_UNLOCK(&cb->eds_sync_lock, NCS_LOCK_WRITE);
 
        /* Await indication from MDS saying EDS is up */
-       m_NCS_SEL_OBJ_ZERO(&set);
-       m_NCS_SEL_OBJ_SET(cb->eds_sync_sel, &set);
-       m_NCS_SEL_OBJ_SELECT(cb->eds_sync_sel, &set, 0, 0, &timeout);
+       osaf_poll_one_fd(m_GET_FD_FROM_SEL_OBJ(cb->eds_sync_sel), 30000);
 
        /* Destroy the sync - object */
        m_NCS_LOCK(&cb->eds_sync_lock, NCS_LOCK_WRITE);
diff --git a/osaf/libs/agents/saf/eda/eda_saf_api.c 
b/osaf/libs/agents/saf/eda/eda_saf_api.c
--- a/osaf/libs/agents/saf/eda/eda_saf_api.c
+++ b/osaf/libs/agents/saf/eda/eda_saf_api.c
@@ -225,7 +225,7 @@ SaAisErrorT saEvtInitialize(SaEvtHandleT
  * allows a process to avoid repeated invoking saEvtDispatch() to see if
  * there is a new event, thus, needlessly consuming CPU time. In a POSIX
  * environment the system handle could be a file descriptor that is used with
- * the poll() or select() system calls to detect incoming callbacks.
+ * the poll() system call to detect incoming callbacks.
  *
  *
  * Parameters

------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to