Skip to content

Commit

Permalink
dont use lj output where it shouldnt be used yet
Browse files Browse the repository at this point in the history
  • Loading branch information
jbalint committed Mar 19, 2013
1 parent afdba72 commit 0f53c3e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lua_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ void lua_interface_init(jvmtiEnv *jvmti, jrawMonitorID mon)
lua_state = luaL_newstate();
if (lua_state == NULL)
{
lj_print_message("Failed to initialize Lua");
fprintf(stderr, "Failed to initialize Lua");
abort();
}
luaL_openlibs(lua_state);
if (luaL_dostring(lua_state, "require('java_bridge')"))
{
lj_print_message("Failed to load java_bridge.lua: %s\n", lua_tostring(lua_state, -1));
fprintf(stderr, "Failed to load java_bridge.lua: %s\n", lua_tostring(lua_state, -1));
abort();
}
/* this must be called AFTER java_bridge.lua is loaded so the metatables for the Java types
Expand All @@ -31,7 +31,7 @@ void lua_interface_init(jvmtiEnv *jvmti, jrawMonitorID mon)
/* this must be called AFTER lj_init() so the JVMTI callbacks can be registered */
if (luaL_dostring(lua_state, "require('debuglib')"))
{
lj_print_message("Failed to load debuglib.lua: %s\n", lua_tostring(lua_state, -1));
fprintf(stderr, "Failed to load debuglib.lua: %s\n", lua_tostring(lua_state, -1));
abort();
}
lj_set_jvm_exec_monitor(mon);
Expand Down
3 changes: 2 additions & 1 deletion lua_java.c
Original file line number Diff line number Diff line change
Expand Up @@ -1398,6 +1398,7 @@ void lj_print_message(const char *format, ...)
{
va_list ap;
va_start(ap, format);
vfprintf(stderr, format, ap);
vprintf(format, ap);
fflush(stdout);
va_end(ap);
}

0 comments on commit 0f53c3e

Please sign in to comment.