diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2017-01-18 10:48:50 +0100 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2017-01-23 20:15:20 +0100 |
commit | e4b9b37ccf8495be674bc15cf0bf9d76fe94e6be (patch) | |
tree | 583f1f5f7db8528410e125cb956eb87b730f6cff /drivers/unix | |
parent | 8e84e53ebb676e43adc7ac4b3e8791790f555695 (diff) |
Avoid calling close when polling a UDP peer without socket
Diffstat (limited to 'drivers/unix')
-rw-r--r-- | drivers/unix/packet_peer_udp_posix.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/unix/packet_peer_udp_posix.cpp b/drivers/unix/packet_peer_udp_posix.cpp index 6adb3eea70..8cdfa03595 100644 --- a/drivers/unix/packet_peer_udp_posix.cpp +++ b/drivers/unix/packet_peer_udp_posix.cpp @@ -157,6 +157,10 @@ Error PacketPeerUDPPosix::wait() { Error PacketPeerUDPPosix::_poll(bool p_wait) { + if (sockfd==-1) { + return FAILED; + } + struct sockaddr_storage from = {0}; socklen_t len = sizeof(struct sockaddr_storage); int ret; |