summaryrefslogtreecommitdiff
path: root/drivers/unix
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2017-01-18 10:48:50 +0100
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2017-01-23 20:15:20 +0100
commite4b9b37ccf8495be674bc15cf0bf9d76fe94e6be (patch)
tree583f1f5f7db8528410e125cb956eb87b730f6cff /drivers/unix
parent8e84e53ebb676e43adc7ac4b3e8791790f555695 (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.cpp4
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;