Fix crashing smartcard-daemon
[platform/core/connectivity/smartcard-service.git] / common / IPCHelper.cpp
index ae368f0..11f7b16 100644 (file)
@@ -197,6 +197,7 @@ ERROR :
 #ifdef USE_IPC_EPOLL
                int events = 0;
 
+again :
                if ((events = epoll_wait(fdPoll, pollEvents, EPOLL_SIZE, -1)) > 0)
                {
                        int i;
@@ -218,6 +219,16 @@ ERROR :
                                }
                        }
                }
+               else
+               {
+                       if (errno == EINTR)
+                       {
+                               char buffer[1024];
+
+                               SCARD_DEBUG_ERR("epoll_wait failed [%d], errno [%d], %s", events, errno, strerror_r(errno, buffer, sizeof(buffer)));
+                               goto again;
+                       }
+               }
 #else
                if (select(ipcSocket + 1, &fdSetRead, NULL, NULL, NULL) > 0)
                {