mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-07 15:04:43 +00:00
Update core.c
fixed indent and vars
This commit is contained in:
parent
ed70d07839
commit
2f64d63144
@ -381,21 +381,21 @@ static int container_attach(lua_State *L)
|
|||||||
struct lxc_container *c = lua_unboxpointer(L, 1, CONTAINER_TYPENAME);
|
struct lxc_container *c = lua_unboxpointer(L, 1, CONTAINER_TYPENAME);
|
||||||
int argc = lua_gettop(L);
|
int argc = lua_gettop(L);
|
||||||
char **argv = NULL;
|
char **argv = NULL;
|
||||||
int i,j;
|
int i;
|
||||||
|
|
||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
argv = alloca((argc+1) * sizeof(char *));
|
argv = alloca((argc+1) * sizeof(char *));
|
||||||
for (i = 0, j = 0; i < argc-1; i++) {
|
for (i = 0; i < argc-1; i++) {
|
||||||
const char *arg = luaL_checkstring(L, i+2);
|
const char *arg = luaL_checkstring(L, i+2);
|
||||||
argv[j++] = strdupa(arg);
|
argv[i] = strdupa(arg);
|
||||||
}
|
|
||||||
argv[j] = NULL;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
lua_pushnil(L);
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
argv[i] = NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lua_pushnil(L);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
lua_pushboolean(L, !!(c->attach_run_wait(c, NULL, argv[0], (const char**)argv)));
|
lua_pushboolean(L, !!(c->attach_run_wait(c, NULL, argv[0], (const char**)argv)));
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user