From: Florian Zeitz Date: Fri, 3 Apr 2015 18:30:14 +0000 (+0200) Subject: util-src/*.c: Per convention call luaL_error() as argument to return X-Git-Url: https://git.enpas.org/?a=commitdiff_plain;h=c74048d7e7bbf4f09f0caeb27023fabd89be83f6;p=prosody.git util-src/*.c: Per convention call luaL_error() as argument to return --- diff --git a/util-src/hashes.c b/util-src/hashes.c index b027423a..a58a424d 100644 --- a/util-src/hashes.c +++ b/util-src/hashes.c @@ -170,7 +170,7 @@ static int LscramHi(lua_State* L) { salt2 = malloc(salt_len + 4); if(salt2 == NULL) { - luaL_error(L, "Out of memory in scramHi"); + return luaL_error(L, "Out of memory in scramHi"); } memcpy(salt2, salt, salt_len); diff --git a/util-src/pposix.c b/util-src/pposix.c index 577576c4..d797f032 100644 --- a/util-src/pposix.c +++ b/util-src/pposix.c @@ -708,7 +708,7 @@ int lc_fallocate(lua_State* L) { FILE* f = *(FILE**) luaL_checkudata(L, 1, LUA_FILEHANDLE); if(f == NULL) { - luaL_error(L, "attempt to use a closed file"); + return luaL_error(L, "attempt to use a closed file"); } offset = luaL_checkinteger(L, 2); 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),