From 5b22c9d8a93762b4b1e2a5682008092f88a8abc1 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sun, 5 Aug 2012 11:44:55 +0100 Subject: COMMS: if read() fails, propagate the error --- lib/supple/comms.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/supple/comms.lua b/lib/supple/comms.lua index ef44666..e72f8f1 100644 --- a/lib/supple/comms.lua +++ b/lib/supple/comms.lua @@ -38,7 +38,10 @@ local function send_msg(msg) end local function recv_msg() - local len = luxio.read(fd, 5) + local len, errno = luxio.read(fd, 5) + if type(len) ~= "string" then + error(luxio.strerror(errno)) + end if #len < 5 then error("Unable to read 5 byte length") end -- cgit v1.2.1