diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2012-08-05 11:44:55 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2012-08-05 11:44:55 +0100 |
commit | 5b22c9d8a93762b4b1e2a5682008092f88a8abc1 (patch) | |
tree | 800fd37008122064cceae9af57196b0a09f6476d | |
parent | 5d273ba981d3717adecbe68a433191f3d3667c7a (diff) | |
download | supple-5b22c9d8a93762b4b1e2a5682008092f88a8abc1.tar.gz |
COMMS: if read() fails, propagate the error
-rw-r--r-- | lib/supple/comms.lua | 5 |
1 files changed, 4 insertions, 1 deletions
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 |