diff options
author | Florian Zeitz <florob@babelmonkeys.de> | 2015-04-03 20:30:14 +0200 |
---|---|---|
committer | Florian Zeitz <florob@babelmonkeys.de> | 2015-04-03 20:30:14 +0200 |
commit | 5a53fb4df8f81b02712a18c911a7c5db12a584c3 (patch) | |
tree | 3f856b706c3324b4f94e498231ac5b75d2d15657 /util-src/signal.c | |
parent | 1930dee18906f9fff6cf667b6593ce53eb639e8d (diff) | |
download | prosody-5a53fb4df8f81b02712a18c911a7c5db12a584c3.tar.gz prosody-5a53fb4df8f81b02712a18c911a7c5db12a584c3.zip |
util-src/*.c: Per convention call luaL_error() as argument to return
Diffstat (limited to 'util-src/signal.c')
-rw-r--r-- | util-src/signal.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/util-src/signal.c b/util-src/signal.c index 4f68c2bf..1e988a2c 100644 --- a/util-src/signal.c +++ b/util-src/signal.c @@ -237,13 +237,14 @@ static int l_signal(lua_State* L) { lua_gettable(L, -2); if(!lua_isnumber(L, -1)) { - luaL_error(L, "invalid signal string"); + return luaL_error(L, "invalid signal string"); } sig = (int) lua_tonumber(L, -1); lua_pop(L, 1); /* get rid of number we pushed */ } else { luaL_checknumber(L, 1); /* will always error, with good error msg */ + return luaL_error(L, "unreachable: invalid number was accepted"); } /* set handler */ @@ -313,7 +314,7 @@ static int l_raise(lua_State* L) { lua_gettable(L, -2); if(!lua_isnumber(L, -1)) { - luaL_error(L, "invalid signal string"); + return luaL_error(L, "invalid signal string"); } ret = (lua_Number) raise((int) lua_tonumber(L, -1)); @@ -357,7 +358,7 @@ static int l_kill(lua_State* L) { lua_gettable(L, -2); if(!lua_isnumber(L, -1)) { - luaL_error(L, "invalid signal string"); + return luaL_error(L, "invalid signal string"); } ret = (lua_Number) kill((int) lua_tonumber(L, 1), |