Skip to content

Commit 138a052

Browse files
committed
resolved the issue of crashes when debugging
1 parent 7637d36 commit 138a052

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/libsrc/XPlaneBeaconListener.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ void XPlaneBeaconListener::runListener() {
149149

150150
if (recv_len < 0) {
151151

152-
if (errno != EWOULDBLOCK) {
152+
if(errno == EINTR && !quitFlag)
153+
continue; //see http://250bpm.com/blog:12
154+
if (errno != EWOULDBLOCK && errno != EAGAIN) {
153155
ostringstream buf;
154156
buf << "recvfrom returned " << recv_len << " errno is " << errno
155157
<< endl;

src/libsrc/XPlaneUDPClient.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,9 @@ void XPlaneUDPClient::listenerThread() {
206206
if ((recv_len = recvfrom(sock, buf, sizeof(buf), 0,
207207
(struct sockaddr *) &remoteAddr, &slen)) < 0) {
208208

209-
if (errno != EWOULDBLOCK) {
209+
if(errno == EINTR && !quitFlag)
210+
continue; //see http://250bpm.com/blog:12
211+
if (errno != EWOULDBLOCK && errno != EAGAIN) {
210212
ostringstream buf;
211213
buf << "recvfrom returned " << recv_len << " errno is " << errno
212214
<< endl;

0 commit comments

Comments
 (0)