#include "security_daemon_socket_config.h"
#include "security_socket_service.h"
-#define TIMEOUT_SEC 0
-#define TIMEOUT_NSEC 100000000
#define MAX_LISTEN 5
#define SIGNAL_TO_CLOSE SIGUSR1
FD_ZERO(&allset);
FD_SET(m_listenFd, &allset);
FD_SET(signal_fd, &allset);
- timespec timeout;
maxfd = (m_listenFd > signal_fd) ? (m_listenFd) : (signal_fd);
++maxfd;
//this will block SIGPIPE for this thread and every thread created in it
pthread_sigmask(SIG_BLOCK, &set, NULL);
while(1){
- timeout.tv_sec = TIMEOUT_SEC;
- timeout.tv_nsec = TIMEOUT_NSEC;
rset = allset;
- if(-1 == pselect(maxfd, &rset, NULL, NULL, &timeout, NULL)){
+ if(-1 == pselect(maxfd, &rset, NULL, NULL, NULL, NULL)){
closeConnections();
throwWithErrnoMessage("pselect()");
}