Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
0ecf64b5
Commit
0ecf64b5
authored
Dec 11, 2013
by
Serge Hallyn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initialize stopped at top of lxc_cmd
and don't do it at all the callers Signed-off-by:
Serge Hallyn
<
serge.hallyn@ubuntu.com
>
parent
814928c8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
commands.c
src/lxc/commands.c
+11
-9
No files found.
src/lxc/commands.c
View file @
0ecf64b5
...
@@ -247,6 +247,8 @@ static int lxc_cmd(const char *name, struct lxc_cmd_rr *cmd, int *stopped,
...
@@ -247,6 +247,8 @@ static int lxc_cmd(const char *name, struct lxc_cmd_rr *cmd, int *stopped,
int
len
;
int
len
;
int
stay_connected
=
cmd
->
req
.
cmd
==
LXC_CMD_CONSOLE
;
int
stay_connected
=
cmd
->
req
.
cmd
==
LXC_CMD_CONSOLE
;
*
stopped
=
0
;
len
=
sizeof
(
path
)
-
1
;
len
=
sizeof
(
path
)
-
1
;
if
(
fill_sock_name
(
offset
,
len
,
name
,
lxcpath
))
if
(
fill_sock_name
(
offset
,
len
,
name
,
lxcpath
))
return
-
1
;
return
-
1
;
...
@@ -293,7 +295,7 @@ out:
...
@@ -293,7 +295,7 @@ out:
int
lxc_try_cmd
(
const
char
*
name
,
const
char
*
lxcpath
)
int
lxc_try_cmd
(
const
char
*
name
,
const
char
*
lxcpath
)
{
{
int
stopped
=
0
,
ret
;
int
stopped
,
ret
;
struct
lxc_cmd_rr
cmd
=
{
struct
lxc_cmd_rr
cmd
=
{
.
req
=
{
.
cmd
=
LXC_CMD_GET_INIT_PID
},
.
req
=
{
.
cmd
=
LXC_CMD_GET_INIT_PID
},
};
};
...
@@ -333,7 +335,7 @@ int lxc_try_cmd(const char *name, const char *lxcpath)
...
@@ -333,7 +335,7 @@ int lxc_try_cmd(const char *name, const char *lxcpath)
*/
*/
pid_t
lxc_cmd_get_init_pid
(
const
char
*
name
,
const
char
*
lxcpath
)
pid_t
lxc_cmd_get_init_pid
(
const
char
*
name
,
const
char
*
lxcpath
)
{
{
int
ret
,
stopped
=
0
;
int
ret
,
stopped
;
struct
lxc_cmd_rr
cmd
=
{
struct
lxc_cmd_rr
cmd
=
{
.
req
=
{
.
cmd
=
LXC_CMD_GET_INIT_PID
},
.
req
=
{
.
cmd
=
LXC_CMD_GET_INIT_PID
},
};
};
...
@@ -363,7 +365,7 @@ static int lxc_cmd_get_init_pid_callback(int fd, struct lxc_cmd_req *req,
...
@@ -363,7 +365,7 @@ static int lxc_cmd_get_init_pid_callback(int fd, struct lxc_cmd_req *req,
*/
*/
int
lxc_cmd_get_clone_flags
(
const
char
*
name
,
const
char
*
lxcpath
)
int
lxc_cmd_get_clone_flags
(
const
char
*
name
,
const
char
*
lxcpath
)
{
{
int
ret
,
stopped
=
0
;
int
ret
,
stopped
;
struct
lxc_cmd_rr
cmd
=
{
struct
lxc_cmd_rr
cmd
=
{
.
req
=
{
.
cmd
=
LXC_CMD_GET_CLONE_FLAGS
},
.
req
=
{
.
cmd
=
LXC_CMD_GET_CLONE_FLAGS
},
};
};
...
@@ -398,7 +400,7 @@ static int lxc_cmd_get_clone_flags_callback(int fd, struct lxc_cmd_req *req,
...
@@ -398,7 +400,7 @@ static int lxc_cmd_get_clone_flags_callback(int fd, struct lxc_cmd_req *req,
char
*
lxc_cmd_get_cgroup_path
(
const
char
*
name
,
const
char
*
lxcpath
,
char
*
lxc_cmd_get_cgroup_path
(
const
char
*
name
,
const
char
*
lxcpath
,
const
char
*
subsystem
)
const
char
*
subsystem
)
{
{
int
ret
,
stopped
=
0
;
int
ret
,
stopped
;
struct
lxc_cmd_rr
cmd
=
{
struct
lxc_cmd_rr
cmd
=
{
.
req
=
{
.
req
=
{
.
cmd
=
LXC_CMD_GET_CGROUP
,
.
cmd
=
LXC_CMD_GET_CGROUP
,
...
@@ -458,7 +460,7 @@ static int lxc_cmd_get_cgroup_callback(int fd, struct lxc_cmd_req *req,
...
@@ -458,7 +460,7 @@ static int lxc_cmd_get_cgroup_callback(int fd, struct lxc_cmd_req *req,
char
*
lxc_cmd_get_config_item
(
const
char
*
name
,
const
char
*
item
,
char
*
lxc_cmd_get_config_item
(
const
char
*
name
,
const
char
*
item
,
const
char
*
lxcpath
)
const
char
*
lxcpath
)
{
{
int
ret
,
stopped
=
0
;
int
ret
,
stopped
;
struct
lxc_cmd_rr
cmd
=
{
struct
lxc_cmd_rr
cmd
=
{
.
req
=
{
.
cmd
=
LXC_CMD_GET_CONFIG_ITEM
,
.
req
=
{
.
cmd
=
LXC_CMD_GET_CONFIG_ITEM
,
.
data
=
item
,
.
data
=
item
,
...
@@ -512,7 +514,7 @@ out:
...
@@ -512,7 +514,7 @@ out:
*/
*/
lxc_state_t
lxc_cmd_get_state
(
const
char
*
name
,
const
char
*
lxcpath
)
lxc_state_t
lxc_cmd_get_state
(
const
char
*
name
,
const
char
*
lxcpath
)
{
{
int
ret
,
stopped
=
0
;
int
ret
,
stopped
;
struct
lxc_cmd_rr
cmd
=
{
struct
lxc_cmd_rr
cmd
=
{
.
req
=
{
.
cmd
=
LXC_CMD_GET_STATE
}
.
req
=
{
.
cmd
=
LXC_CMD_GET_STATE
}
};
};
...
@@ -553,7 +555,7 @@ static int lxc_cmd_get_state_callback(int fd, struct lxc_cmd_req *req,
...
@@ -553,7 +555,7 @@ static int lxc_cmd_get_state_callback(int fd, struct lxc_cmd_req *req,
*/
*/
int
lxc_cmd_stop
(
const
char
*
name
,
const
char
*
lxcpath
)
int
lxc_cmd_stop
(
const
char
*
name
,
const
char
*
lxcpath
)
{
{
int
ret
,
stopped
=
0
;
int
ret
,
stopped
;
struct
lxc_cmd_rr
cmd
=
{
struct
lxc_cmd_rr
cmd
=
{
.
req
=
{
.
cmd
=
LXC_CMD_STOP
},
.
req
=
{
.
cmd
=
LXC_CMD_STOP
},
};
};
...
@@ -618,7 +620,7 @@ static int lxc_cmd_stop_callback(int fd, struct lxc_cmd_req *req,
...
@@ -618,7 +620,7 @@ static int lxc_cmd_stop_callback(int fd, struct lxc_cmd_req *req,
*/
*/
int
lxc_cmd_console_winch
(
const
char
*
name
,
const
char
*
lxcpath
)
int
lxc_cmd_console_winch
(
const
char
*
name
,
const
char
*
lxcpath
)
{
{
int
ret
,
stopped
=
0
;
int
ret
,
stopped
;
struct
lxc_cmd_rr
cmd
=
{
struct
lxc_cmd_rr
cmd
=
{
.
req
=
{
.
cmd
=
LXC_CMD_CONSOLE_WINCH
},
.
req
=
{
.
cmd
=
LXC_CMD_CONSOLE_WINCH
},
};
};
...
@@ -652,7 +654,7 @@ static int lxc_cmd_console_winch_callback(int fd, struct lxc_cmd_req *req,
...
@@ -652,7 +654,7 @@ static int lxc_cmd_console_winch_callback(int fd, struct lxc_cmd_req *req,
*/
*/
int
lxc_cmd_console
(
const
char
*
name
,
int
*
ttynum
,
int
*
fd
,
const
char
*
lxcpath
)
int
lxc_cmd_console
(
const
char
*
name
,
int
*
ttynum
,
int
*
fd
,
const
char
*
lxcpath
)
{
{
int
ret
,
stopped
=
0
;
int
ret
,
stopped
;
struct
lxc_cmd_console_rsp_data
*
rspdata
;
struct
lxc_cmd_console_rsp_data
*
rspdata
;
struct
lxc_cmd_rr
cmd
=
{
struct
lxc_cmd_rr
cmd
=
{
.
req
=
{
.
cmd
=
LXC_CMD_CONSOLE
,
.
data
=
INT_TO_PTR
(
*
ttynum
)
},
.
req
=
{
.
cmd
=
LXC_CMD_CONSOLE
,
.
data
=
INT_TO_PTR
(
*
ttynum
)
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment