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
6a93ae77
Unverified
Commit
6a93ae77
authored
Jun 22, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commands: simplify lxc_cmd()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
3cc0d428
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
commands.c
src/lxc/commands.c
+8
-11
No files found.
src/lxc/commands.c
View file @
6a93ae77
...
@@ -309,21 +309,22 @@ static int lxc_cmd(const char *name, struct lxc_cmd_rr *cmd, int *stopped,
...
@@ -309,21 +309,22 @@ static int lxc_cmd(const char *name, struct lxc_cmd_rr *cmd, int *stopped,
if
(
client_fd
<
0
)
{
if
(
client_fd
<
0
)
{
TRACE
(
"%s - Command
\"
%s
\"
failed to connect command socket"
,
TRACE
(
"%s - Command
\"
%s
\"
failed to connect command socket"
,
strerror
(
errno
),
lxc_cmd_str
(
cmd
->
req
.
cmd
));
strerror
(
errno
),
lxc_cmd_str
(
cmd
->
req
.
cmd
));
if
(
client_fd
==
-
ECONNREFUSED
)
{
if
(
client_fd
==
-
ECONNREFUSED
)
*
stopped
=
1
;
*
stopped
=
1
;
return
-
1
;
}
if
(
client_fd
==
-
EPIPE
)
if
(
client_fd
==
-
EPIPE
)
{
goto
epipe
;
*
stopped
=
1
;
client_fd
=
0
;
}
goto
out
;
return
client_fd
;
}
}
ret
=
lxc_cmd_rsp_recv
(
client_fd
,
cmd
);
ret
=
lxc_cmd_rsp_recv
(
client_fd
,
cmd
);
if
(
ret
==
-
ECONNRESET
)
if
(
ret
==
-
ECONNRESET
)
*
stopped
=
1
;
*
stopped
=
1
;
out:
if
(
!
stay_connected
||
ret
<=
0
)
if
(
!
stay_connected
||
ret
<=
0
)
if
(
client_fd
>=
0
)
if
(
client_fd
>=
0
)
close
(
client_fd
);
close
(
client_fd
);
...
@@ -332,10 +333,6 @@ out:
...
@@ -332,10 +333,6 @@ out:
cmd
->
rsp
.
ret
=
client_fd
;
cmd
->
rsp
.
ret
=
client_fd
;
return
ret
;
return
ret
;
epipe:
*
stopped
=
1
;
return
0
;
}
}
int
lxc_try_cmd
(
const
char
*
name
,
const
char
*
lxcpath
)
int
lxc_try_cmd
(
const
char
*
name
,
const
char
*
lxcpath
)
...
...
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