From daa5bbf25a52f3db0ad722578a99f540461b2844 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 21 May 2024 17:49:08 +0200 Subject: [PATCH] [kernel] Handle timeout OTP-19063 --- lib/kernel/src/socket.erl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/kernel/src/socket.erl b/lib/kernel/src/socket.erl index 68e79e599c34..36952aa504a7 100644 --- a/lib/kernel/src/socket.erl +++ b/lib/kernel/src/socket.erl @@ -3440,6 +3440,8 @@ recv(?socket(SockRef), Length, Flags, Timeout) case prim_socket:recv(SockRef, Length, Flags, zero) of ok -> {error, timeout}; + timeout -> + {error, timeout}; Result -> Result end; @@ -3838,6 +3840,8 @@ recvfrom(?socket(SockRef), BufSz, Flags, Timeout) case prim_socket:recvfrom(SockRef, BufSz, Flags, zero) of ok -> {error, timeout}; + timeout -> + {error, timeout}; Result -> recvfrom_result(Result) end; @@ -4137,6 +4141,8 @@ recvmsg(?socket(SockRef), BufSz, CtrlSz, Flags, Timeout) case prim_socket:recvmsg(SockRef, BufSz, CtrlSz, Flags, zero) of ok -> {error, timeout}; + timeout -> + {error, timeout}; Result -> recvmsg_result(Result) end;