From 77a7e7b81b20b68ba7060e664d44a4d6c764c3f7 Mon Sep 17 00:00:00 2001 From: Nikolaus Gullotta Date: Wed, 25 Nov 2020 09:30:15 -0600 Subject: [PATCH] Return actual result from LuaState::do_file and luaL_dofile --- luasession/luasession.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/luasession/luasession.cc b/luasession/luasession.cc index 8d407adf83..8d149a0a24 100644 --- a/luasession/luasession.cc +++ b/luasession/luasession.cc @@ -604,8 +604,10 @@ main (int argc, char** argv) lua_setglobal (L, "arg"); } + int res = 0; + if (argc > optind && 0 != strcmp (argv[optind], "-")) { - lua->do_file (argv[optind]); + res = lua->do_file (argv[optind]); if (!interactive) { keep_running = false; } @@ -616,7 +618,7 @@ main (int argc, char** argv) } else if (is_tty () || interactive) { interactive_interpreter (); } else { - luaL_dofile (lua->getState (), NULL); + res = luaL_dofile (lua->getState (), NULL); } if (session) { @@ -634,5 +636,5 @@ main (int argc, char** argv) ARDOUR::cleanup (); delete event_loop; pthread_cancel_all (); - return 0; + return res; }