Compare commits
2 Commits
0b9189a412
...
cafb33d5f0
| Author | SHA1 | Date | |
|---|---|---|---|
| cafb33d5f0 | |||
| eaede95bac |
@@ -90,8 +90,7 @@ int start_lua_child(lua_State *L,
|
||||
lua_setglobal(L, "arg");
|
||||
int status = luaL_dofile(L, pathname);
|
||||
if (status) {
|
||||
fprintf(stderr, "Error: %s\n", lua_tostring(L, -1));
|
||||
return 1;
|
||||
die("Lua error: %s", lua_tostring(L, -1));
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
@@ -216,6 +215,9 @@ int main(int argc, char **argv)
|
||||
int len = recvmsg(socket, &msg , 0);
|
||||
int *peer_fds = fds_from_msg(&msg, 5);
|
||||
char *argline = malloc(len);
|
||||
if(! argline) {
|
||||
die("malloc failed");
|
||||
}
|
||||
memmove(argline, buf, len);
|
||||
|
||||
pid_t child_pid = fork_lua(L, argline, len, peer_fds, 5);
|
||||
|
||||
Reference in New Issue
Block a user