summaryrefslogtreecommitdiffstats
path: root/drivers/unix/packet_peer_udp_posix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/unix/packet_peer_udp_posix.cpp')
-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;