osaf/libs/agents/saf/imma/imma_init.c |  7 ++-----
 osaf/tools/safimm/immfind/imm_find.c  |  1 -
 osaf/tools/safimm/immlist/imm_list.c  |  1 -
 3 files changed, 2 insertions(+), 7 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/imma/imma_init.c 
b/osaf/libs/agents/saf/imma/imma_init.c
--- a/osaf/libs/agents/saf/imma/imma_init.c
+++ b/osaf/libs/agents/saf/imma/imma_init.c
@@ -27,6 +27,7 @@
 #include <string.h>
 
 #include "imma.h"
+#include "osaf_poll.h"
 
 /*****************************************************************************
  global data used by IMMA
@@ -57,8 +58,6 @@ IMMA_CB imma_cb;
 
 static void imma_sync_with_immnd(IMMA_CB *cb)
 {
-       NCS_SEL_OBJ_SET set;
-       uint32_t timeout = 3000;
        TRACE_ENTER();
 
        m_NCS_LOCK(&cb->immnd_sync_lock,NCS_LOCK_WRITE);
@@ -74,9 +73,7 @@ static void imma_sync_with_immnd(IMMA_CB
        m_NCS_UNLOCK(&cb->immnd_sync_lock,NCS_LOCK_WRITE);
 
        /* Await indication from MDS saying IMMND is up */
-       m_NCS_SEL_OBJ_ZERO(&set);
-       m_NCS_SEL_OBJ_SET(cb->immnd_sync_sel, &set);
-       m_NCS_SEL_OBJ_SELECT(cb->immnd_sync_sel, &set, 0 , 0, &timeout);
+       osaf_poll_one_fd(m_GET_FD_FROM_SEL_OBJ(cb->immnd_sync_sel), 30000);
        TRACE("Blocking wait released");
 
        /* Destroy the sync - object */
diff --git a/osaf/tools/safimm/immfind/imm_find.c 
b/osaf/tools/safimm/immfind/imm_find.c
--- a/osaf/tools/safimm/immfind/imm_find.c
+++ b/osaf/tools/safimm/immfind/imm_find.c
@@ -28,7 +28,6 @@
 #include <getopt.h>
 #include <sys/types.h>
 #include <sys/socket.h>
-#include <sys/select.h>
 #include <sys/un.h>
 #include <sys/time.h>
 #include <fcntl.h>
diff --git a/osaf/tools/safimm/immlist/imm_list.c 
b/osaf/tools/safimm/immlist/imm_list.c
--- a/osaf/tools/safimm/immlist/imm_list.c
+++ b/osaf/tools/safimm/immlist/imm_list.c
@@ -28,7 +28,6 @@
 #include <getopt.h>
 #include <sys/types.h>
 #include <sys/socket.h>
-#include <sys/select.h>
 #include <sys/un.h>
 #include <sys/time.h>
 #include <fcntl.h>

------------------------------------------------------------------------------
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