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
1a6cb1ce
Commit
1a6cb1ce
authored
Jul 09, 2017
by
Christian Brauner
Committed by
GitHub
Jul 09, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1687 from 0x0916/2017-07-09/delete-comments
delete comments
parents
74d2af40
1e8cfdf6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
13 deletions
+3
-13
commands.c
src/lxc/commands.c
+2
-12
commands_utils.c
src/lxc/commands_utils.c
+1
-1
No files found.
src/lxc/commands.c
View file @
1a6cb1ce
...
@@ -116,7 +116,7 @@ static const char *lxc_cmd_str(lxc_cmd_t cmd)
...
@@ -116,7 +116,7 @@ static const char *lxc_cmd_str(lxc_cmd_t cmd)
*/
*/
static
int
lxc_cmd_rsp_recv
(
int
sock
,
struct
lxc_cmd_rr
*
cmd
)
static
int
lxc_cmd_rsp_recv
(
int
sock
,
struct
lxc_cmd_rr
*
cmd
)
{
{
int
ret
,
rspfd
;
int
ret
,
rspfd
;
struct
lxc_cmd_rsp
*
rsp
=
&
cmd
->
rsp
;
struct
lxc_cmd_rsp
*
rsp
=
&
cmd
->
rsp
;
ret
=
lxc_abstract_unix_recv_fds
(
sock
,
&
rspfd
,
1
,
rsp
,
sizeof
(
*
rsp
));
ret
=
lxc_abstract_unix_recv_fds
(
sock
,
&
rspfd
,
1
,
rsp
,
sizeof
(
*
rsp
));
...
@@ -212,11 +212,6 @@ static int lxc_cmd_send(const char *name, struct lxc_cmd_rr *cmd,
...
@@ -212,11 +212,6 @@ static int lxc_cmd_send(const char *name, struct lxc_cmd_rr *cmd,
int
client_fd
;
int
client_fd
;
int
ret
=
-
1
;
int
ret
=
-
1
;
/* -2 here because this is an abstract unix socket so it needs a
* leading \0, and we null terminate, so it needs a trailing \0.
* Although null termination isn't required by the API, we do it anyway
* because we print the sockname out sometimes.
*/
client_fd
=
lxc_cmd_connect
(
name
,
lxcpath
,
hashed_sock_name
);
client_fd
=
lxc_cmd_connect
(
name
,
lxcpath
,
hashed_sock_name
);
if
(
client_fd
<
0
&&
client_fd
==
-
ECONNREFUSED
)
if
(
client_fd
<
0
&&
client_fd
==
-
ECONNREFUSED
)
return
-
ECONNREFUSED
;
return
-
ECONNREFUSED
;
...
@@ -265,7 +260,7 @@ static int lxc_cmd_send(const char *name, struct lxc_cmd_rr *cmd,
...
@@ -265,7 +260,7 @@ static int lxc_cmd_send(const char *name, struct lxc_cmd_rr *cmd,
* request and collect the response
* request and collect the response
*
*
* @name : name of container to connect to
* @name : name of container to connect to
* @cmd : command with initialized reqest to send
* @cmd : command with initialized req
u
est to send
* @stopped : output indicator if the container was not running
* @stopped : output indicator if the container was not running
* @lxcpath : the lxcpath in which the container is running
* @lxcpath : the lxcpath in which the container is running
*
*
...
@@ -291,11 +286,6 @@ static int lxc_cmd(const char *name, struct lxc_cmd_rr *cmd, int *stopped,
...
@@ -291,11 +286,6 @@ static int lxc_cmd(const char *name, struct lxc_cmd_rr *cmd, int *stopped,
*
stopped
=
0
;
*
stopped
=
0
;
/* -2 here because this is an abstract unix socket so it needs a
* leading \0, and we null terminate, so it needs a trailing \0.
* Although null termination isn't required by the API, we do it anyway
* because we print the sockname out sometimes.
*/
TRACE
(
"command %s tries to connect command socket"
,
TRACE
(
"command %s tries to connect command socket"
,
lxc_cmd_str
(
cmd
->
req
.
cmd
));
lxc_cmd_str
(
cmd
->
req
.
cmd
));
...
...
src/lxc/commands_utils.c
View file @
1a6cb1ce
...
@@ -168,13 +168,13 @@ int lxc_cmd_connect(const char *name, const char *lxcpath,
...
@@ -168,13 +168,13 @@ int lxc_cmd_connect(const char *name, const char *lxcpath,
int
ret
,
client_fd
;
int
ret
,
client_fd
;
char
path
[
sizeof
(((
struct
sockaddr_un
*
)
0
)
->
sun_path
)]
=
{
0
};
char
path
[
sizeof
(((
struct
sockaddr_un
*
)
0
)
->
sun_path
)]
=
{
0
};
char
*
offset
=
&
path
[
1
];
char
*
offset
=
&
path
[
1
];
size_t
len
=
sizeof
(
path
)
-
2
;
/* -2 here because this is an abstract unix socket so it needs a
/* -2 here because this is an abstract unix socket so it needs a
* leading \0, and we null terminate, so it needs a trailing \0.
* leading \0, and we null terminate, so it needs a trailing \0.
* Although null termination isn't required by the API, we do it anyway
* Although null termination isn't required by the API, we do it anyway
* because we print the sockname out sometimes.
* because we print the sockname out sometimes.
*/
*/
size_t
len
=
sizeof
(
path
)
-
2
;
ret
=
lxc_make_abstract_socket_name
(
offset
,
len
,
name
,
lxcpath
,
ret
=
lxc_make_abstract_socket_name
(
offset
,
len
,
name
,
lxcpath
,
hashed_sock_name
,
"command"
);
hashed_sock_name
,
"command"
);
if
(
ret
<
0
)
if
(
ret
<
0
)
...
...
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