summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-09-07 16:23:32 +0300
committerPanu Matilainen <pmatilai@redhat.com>2009-09-07 16:23:32 +0300
commit6fb96f3847bed4c2aba52497eb26b0d2d52207f9 (patch)
tree9fd150d00ef7d2c8b56f60e4971cc739c1e1ec2c
parent475ba2111f5c3e0eb755a954785e09d3a35dfabf (diff)
downloadrpm-6fb96f3847bed4c2aba52497eb26b0d2d52207f9.tar.gz
rpm-6fb96f3847bed4c2aba52497eb26b0d2d52207f9.tar.bz2
rpm-6fb96f3847bed4c2aba52497eb26b0d2d52207f9.zip
Help compilers/analyzers a bit with luaL_error()
- luaL_error() never returns but as other tools dont know this it raises false alarms
-rw-r--r--luaext/lposix.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/luaext/lposix.c b/luaext/lposix.c
index 270e2464f..cf609a5a9 100644
--- a/luaext/lposix.c
+++ b/luaext/lposix.c
@@ -183,7 +183,7 @@ static int aux_files(lua_State *L)
{
DIR *d = lua_touserdata(L, lua_upvalueindex(1));
struct dirent *entry;
- if (d == NULL) luaL_error(L, "attempt to use closed dir");
+ if (d == NULL) return luaL_error(L, "attempt to use closed dir");
entry = readdir(d);
if (entry == NULL)
{
@@ -319,7 +319,7 @@ static int Pexec(lua_State *L) /** exec(path,[args]) */
const char *path = luaL_checkstring(L, 1);
int i,n=lua_gettop(L);
char **argv = malloc((n+1)*sizeof(char*));
- if (argv==NULL) luaL_error(L,"not enough memory");
+ if (argv==NULL) return luaL_error(L,"not enough memory");
argv[0] = (char*)path;
for (i=1; i<n; i++) argv[i] = (char*)luaL_checkstring(L, i+1);
argv[i] = NULL;
@@ -782,7 +782,7 @@ static int Pmkstemp(lua_State *L)
luaL_getmetatable(L, "FILE*");
if (lua_isnil(L, -1)) {
lua_pop(L, 1);
- luaL_error(L, "FILE* metatable not available "
+ return luaL_error(L, "FILE* metatable not available "
"(io not loaded?)");
} else {
lua_setmetatable(L, -3);