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
f6f4304b
Unverified
Commit
f6f4304b
authored
Feb 17, 2019
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commands: cleanup macros lxc_cmd_add_state_client
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
82bc16c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
commands.c
src/lxc/commands.c
+6
-5
No files found.
src/lxc/commands.c
View file @
f6f4304b
...
@@ -828,6 +828,7 @@ int lxc_cmd_add_state_client(const char *name, const char *lxcpath,
...
@@ -828,6 +828,7 @@ int lxc_cmd_add_state_client(const char *name, const char *lxcpath,
lxc_state_t
states
[
MAX_STATE
],
lxc_state_t
states
[
MAX_STATE
],
int
*
state_client_fd
)
int
*
state_client_fd
)
{
{
__do_close_prot_errno
int
clientfd
=
-
EBADF
;
int
state
,
stopped
;
int
state
,
stopped
;
ssize_t
ret
;
ssize_t
ret
;
struct
lxc_cmd_rr
cmd
=
{
struct
lxc_cmd_rr
cmd
=
{
...
@@ -852,8 +853,9 @@ int lxc_cmd_add_state_client(const char *name, const char *lxcpath,
...
@@ -852,8 +853,9 @@ int lxc_cmd_add_state_client(const char *name, const char *lxcpath,
/* We should now be guaranteed to get an answer from the state sending
/* We should now be guaranteed to get an answer from the state sending
* function.
* function.
*/
*/
if
(
cmd
.
rsp
.
ret
<
0
)
{
clientfd
=
cmd
.
rsp
.
ret
;
errno
=
-
cmd
.
rsp
.
ret
;
if
(
clientfd
<
0
)
{
errno
=
-
clientfd
;
SYSERROR
(
"Failed to receive socket fd"
);
SYSERROR
(
"Failed to receive socket fd"
);
return
-
1
;
return
-
1
;
}
}
...
@@ -861,12 +863,11 @@ int lxc_cmd_add_state_client(const char *name, const char *lxcpath,
...
@@ -861,12 +863,11 @@ int lxc_cmd_add_state_client(const char *name, const char *lxcpath,
state
=
PTR_TO_INT
(
cmd
.
rsp
.
data
);
state
=
PTR_TO_INT
(
cmd
.
rsp
.
data
);
if
(
state
<
MAX_STATE
)
{
if
(
state
<
MAX_STATE
)
{
TRACE
(
"Container is already in requested state %s"
,
lxc_state2str
(
state
));
TRACE
(
"Container is already in requested state %s"
,
lxc_state2str
(
state
));
close
(
cmd
.
rsp
.
ret
);
return
state
;
return
state
;
}
}
*
state_client_fd
=
cmd
.
rsp
.
ret
;
*
state_client_fd
=
steal_fd
(
clientfd
)
;
TRACE
(
"Added state client %d to state client list"
,
cmd
.
rsp
.
ret
);
TRACE
(
"Added state client %d to state client list"
,
*
state_client_fd
);
return
MAX_STATE
;
return
MAX_STATE
;
}
}
...
...
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