don't exit

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8229 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-05-01 01:22:25 +00:00
parent 9087158ce1
commit 471f176ade
1 changed files with 18 additions and 14 deletions

View File

@ -53,20 +53,6 @@ static int panic (lua_State *L)
return 0;
}
static lua_State *lua_init(void)
{
lua_State *L = lua_open();
if (L) {
lua_gc(L, LUA_GCSTOP, 0);
luaL_openlibs(L);
luaopen_freeswitch(L);
lua_gc(L, LUA_GCRESTART, 0);
lua_atpanic(L, panic);
}
return L;
}
static void lua_uninit(lua_State *L)
{
lua_gc(L, LUA_GCCOLLECT, 0);
@ -105,6 +91,24 @@ static int docall (lua_State *L, int narg, int clear) {
return status;
}
static lua_State *lua_init(void)
{
lua_State *L = lua_open();
if (L) {
const char *buff = "os.exit = function() freeswitch.consoleLog(\"err\", \"Surely you jest! exiting is a bad plan....\\n\") end";
lua_gc(L, LUA_GCSTOP, 0);
luaL_openlibs(L);
luaopen_freeswitch(L);
lua_gc(L, LUA_GCRESTART, 0);
lua_atpanic(L, panic);
luaL_loadbuffer(L, buff, strlen(buff), "line") || docall(L, 0, 1);
}
return L;
}
static void lua_parse_and_execute(lua_State *L, char *input_code)
{
int error = 0;