From e564406695cc2968eda18bf40daf386fd7e1a5ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E9=A3=8E?= Date: Tue, 23 Jul 2013 14:39:38 +0800 Subject: [PATCH] minor fix --- lualib/redis.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lualib/redis.lua b/lualib/redis.lua index 482a9aba..f48addd1 100644 --- a/lualib/redis.lua +++ b/lualib/redis.lua @@ -20,8 +20,7 @@ local meta = { function redis.connect(dbname) local db_conf = name[dbname] - local fd = socket.open(db_conf.host, db_conf.port or 6379) - assert(fd) + local fd = assert(socket.open(db_conf.host, db_conf.port or 6379)) local r = setmetatable( { __handle = fd, __mode = false }, meta ) if db_conf.db ~= nil then r:select(db_conf.db)