Skip to content
Permalink
Browse files

Merge PR #1442 (open auditlog during init) into max-next

  • Loading branch information...
eugeneia committed Nov 4, 2019
2 parents e957550 + 3dec0d3 commit d7c8974095987276c97f479e126dfdc8454a3ff5
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/core/main.lua
@@ -47,15 +47,14 @@ function main ()
error("fatal: "..ffi.os.."/"..ffi.arch.." is not a supported platform\n")
end
initialize()
vmprofile.start()
if lib.getenv("SNABB_PROGRAM_LUACODE") then
-- Run the given Lua code instead of the command-line
local expr = lib.getenv("SNABB_PROGRAM_LUACODE")
local f = loadstring(expr)
if f == nil then
error(("Failed to load $SNABB_PROGRAM_LUACODE: %q"):format(expr))
else
engine.setvmprofile("program")
vmprofile.start()
f()
end
else
@@ -65,8 +64,6 @@ function main ()
print("unsupported program: "..program:gsub("_", "-"))
usage(1)
else
engine.setvmprofile("program")
vmprofile.start()
require(modulename(program)).run(args)
end
end
@@ -165,6 +162,9 @@ function initialize ()
_G.packet = require("core.packet"); _G.packet.initialize()
_G.timer = require("core.timer")
_G.main = getfenv()
-- Setup audit.log, vmprofile
engine.enable_auditlog()
engine.setvmprofile("program")
end

function handler (reason)

0 comments on commit d7c8974

Please sign in to comment.
You can’t perform that action at this time.