Created
September 12, 2012 11:58
-
-
Save hnakamur/3706154 to your computer and use it in GitHub Desktop.
parameters to script are not passed to workers.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I added debug prints. | |
``` | |
static int pmain(lua_State *L) { | |
uv_loop_t *loop; | |
/*uv_timer_t gc_timer;*/ | |
struct Smain *s = (struct Smain *)lua_touserdata(L, 1); | |
char **argv = s->argv; | |
int script; | |
int flags = 0; | |
globalL = L; | |
for (int i = 1; argv[i] != NULL; i++) { | |
printf("pmain worker_id=%s arg[%d]=%s\n", getenv("LEV_WORKER_ID"), i, argv[i]); | |
} | |
if (argv[0] && argv[0][0]) progname = argv[0]; | |
``` | |
The output was: | |
``` | |
pmain worker_id=(null) arg[1]=tools/checkit | |
pmain worker_id=(null) arg[2]=tests/test-fs-stat.lua | |
pmain worker_id=1 arg[1]=tools/checkit | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment