Skip to content

Commit

Permalink
luajit.c: Add 'raptorjit -a <path> ...' command line auditlog syntax
Browse files Browse the repository at this point in the history
Now you can enable the auditlog from the command line.
  • Loading branch information
lukego committed Dec 11, 2017
1 parent 671d770 commit 07fef11
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/luajit.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "luajit.h"

#include "lj_arch.h"
#include "lj_auditlog.h"

#include <unistd.h>
#define lua_stdin_is_tty() isatty(0)
Expand Down Expand Up @@ -58,6 +59,7 @@ static void print_usage(void)
" -i Enter interactive mode after executing " LUA_QL("script") ".\n"
" -v Show version information.\n"
" -E Ignore environment variables.\n"
" -a path Enable auditlog at path.\n"
" -- Stop handling options.\n"
" - Execute stdin and stop handling options.\n", stderr);
fflush(stderr);
Expand Down Expand Up @@ -402,6 +404,7 @@ static int collectargs(char **argv, int *flags)
break;
case 'e':
*flags |= FLAGS_EXEC;
case 'a': /* RaptorJIT extension */
case 'j': /* LuaJIT extension */
case 'l':
*flags |= FLAGS_OPTION;
Expand Down Expand Up @@ -461,6 +464,11 @@ static int runargs(lua_State *L, char **argv, int argn)
break;
case 'b': /* LuaJIT extension. */
return dobytecode(L, argv+i);
case 'a': /* RaptorJIT extension. */
if (!lj_auditlog_open(argv[++i])) {
fprintf(stderr, "unable to open auditlog\n");
fflush(stderr);
}
default: break;
}
}
Expand Down

0 comments on commit 07fef11

Please sign in to comment.