You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: common/select.cpp
+12-1
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
#include"common/selectable.h"
2
2
#include"common/logger.h"
3
3
#include"common/select.h"
4
+
#include"common/signalhandlerhelper.h"
4
5
#include<algorithm>
5
6
#include<stdio.h>
6
7
#include<sys/time.h>
@@ -9,6 +10,7 @@
9
10
#include<unistd.h>
10
11
#include<string.h>
11
12
13
+
12
14
usingnamespacestd;
13
15
14
16
namespaceswss {
@@ -97,7 +99,13 @@ int Select::poll_descriptors(Selectable **c, unsigned int timeout)
97
99
{
98
100
ret = ::epoll_wait(m_epoll_fd, events.data(), sz_selectables, timeout);
99
101
}
100
-
while(ret == -1 && errno == EINTR); // Retry the select if the process was interrupted by a signal
102
+
while(ret == -1 && errno == EINTR && !SignalHandlerHelper::checkSignal(Signals::SIGNAL_INT)); // Retry the select if the process was interrupted by a signal
103
+
104
+
if (SignalHandlerHelper::checkSignal(Signals::SIGNAL_INT))
105
+
{
106
+
// Return if the epoll_wait was interrupted by SIGTERM
0 commit comments