Skip to content
Snippets Groups Projects
Commit 9964c242 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Signal safe implementation of the wait functions of the CEventServer class

parent ac1c784d
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,7 @@
#include "ctime.h"
#include "eventserver.h"
#include "eventexceptions.h"
#include <errno.h>
CEventServer *CEventServer::pinstance=NULL;
......@@ -236,8 +237,11 @@ int CEventServer::wait_first(std::list<std::string> events,int timeout)
error=select(max_fd+1,&wait_set,NULL,NULL,NULL);
if(error==-1)
{
/* handle exceptions */
throw CEventServerException(_HERE_,"Unexpected error while waiting the activation of one the events",event_list);
if(errno!=EINTR)
{
/* handle exceptions */
throw CEventServerException(_HERE_,"Unexpected error while waiting the activation of one the events",event_list);
}
}
else if(error==0)
{
......@@ -322,8 +326,11 @@ void CEventServer::wait_all(std::list<std::string> events,int timeout)
error=select(max_fd+1,&wait_set,NULL,NULL,NULL);
if(error==-1)
{
/* handle exceptions */
throw CEventServerException(_HERE_,"Unexpected error while waiting the activation of one the events",event_list);
if(errno!=EINTR)
{
/* handle exceptions */
throw CEventServerException(_HERE_,"Unexpected error while waiting the activation of one the events",event_list);
}
}
else if(error==0)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment