- Timestamp:
- May 28, 2019 10:42:24 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/poll.cpp
r76553 r78832 43 43 # include <errno.h> 44 44 # include <sys/poll.h> 45 # if defined(RT_OS_SOLARIS) 46 # include <sys/socket.h> 47 # endif 45 48 #endif 46 49 … … 417 420 ) 418 421 ) 419 *pfEvents |= RTPOLL_EVT_ERROR; 422 *pfEvents |= RTPOLL_EVT_ERROR; 423 424 # if defined(RT_OS_SOLARIS) 425 /* Solaris does not return POLLHUP for sockets, just POLLIN. Check if a 426 POLLIN should also have RTPOLL_EVT_ERROR set or not, so we present a 427 behaviour more in line with linux and BSDs. Note that this will not 428 help is only RTPOLL_EVT_ERROR was requested, that will require 429 extending this hack quite a bit further (restart poll): */ 430 if ( *pfEvents == RTPOLL_EVT_READ 431 && pThis->paHandles[i].enmType == RTHANDLETYPE_SOCKET) 432 { 433 uint8_t abBuf[64]; 434 ssize_t rcRecv = recv(pThis->paPollFds[i].fd, abBuf, sizeof(abBuf), MSG_PEEK | MSG_DONTWAIT); 435 if (rcRecv == 0) 436 *pfEvents |= RTPOLL_EVT_ERROR; 437 } 438 # endif 420 439 } 421 440 if (pid)
Note:
See TracChangeset
for help on using the changeset viewer.