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
46968ea3
Commit
46968ea3
authored
Oct 07, 2009
by
Daniel Lezcano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix the abstract unix socket name
Let's use a more sexy name Signed-off-by:
Daniel Lezcano
<
dlezcano@fr.ibm.com
>
parent
e98fe68b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
commands.c
src/lxc/commands.c
+8
-10
No files found.
src/lxc/commands.c
View file @
46968ea3
...
@@ -54,14 +54,13 @@ static int receive_answer(int sock, struct lxc_answer *answer)
...
@@ -54,14 +54,13 @@ static int receive_answer(int sock, struct lxc_answer *answer)
extern
int
lxc_command
(
const
char
*
name
,
struct
lxc_command
*
command
)
extern
int
lxc_command
(
const
char
*
name
,
struct
lxc_command
*
command
)
{
{
struct
sockaddr_un
addr
=
{
0
};
int
sock
,
ret
=
-
1
;
int
sock
,
ret
=
-
1
;
char
*
offset
=
&
addr
.
sun_path
[
1
];
char
path
[
sizeof
(((
struct
sockaddr_un
*
)
0
)
->
sun_path
)]
=
{
0
};
char
*
offset
=
&
path
[
1
];
snprintf
(
addr
.
sun_path
,
sizeof
(
addr
.
sun_path
),
"@%s"
,
name
);
sprintf
(
offset
,
"/var/run/lxc/%s/command"
,
name
);
addr
.
sun_path
[
0
]
=
'\0'
;
sock
=
lxc_af_unix_connect
(
addr
.
sun_
path
);
sock
=
lxc_af_unix_connect
(
path
);
if
(
sock
<
0
)
{
if
(
sock
<
0
)
{
WARN
(
"failed to connect to '@%s': %s"
,
offset
,
strerror
(
errno
));
WARN
(
"failed to connect to '@%s': %s"
,
offset
,
strerror
(
errno
));
return
-
1
;
return
-
1
;
...
@@ -202,13 +201,12 @@ extern int lxc_command_mainloop_add(const char *name, struct lxc_epoll_descr *de
...
@@ -202,13 +201,12 @@ extern int lxc_command_mainloop_add(const char *name, struct lxc_epoll_descr *de
struct
lxc_handler
*
handler
)
struct
lxc_handler
*
handler
)
{
{
int
ret
,
fd
;
int
ret
,
fd
;
struct
sockaddr_un
addr
=
{
0
};
char
path
[
sizeof
(((
struct
sockaddr_un
*
)
0
)
->
sun_path
)]
=
{
0
};
char
*
offset
=
&
addr
.
sun_
path
[
1
];
char
*
offset
=
&
path
[
1
];
strcpy
(
offset
,
name
);
sprintf
(
offset
,
"/var/run/lxc/%s/command"
,
name
);
addr
.
sun_path
[
0
]
=
'\0'
;
fd
=
lxc_af_unix_open
(
addr
.
sun_
path
,
SOCK_STREAM
,
0
);
fd
=
lxc_af_unix_open
(
path
,
SOCK_STREAM
,
0
);
if
(
fd
<
0
)
{
if
(
fd
<
0
)
{
ERROR
(
"failed to create the command service point"
);
ERROR
(
"failed to create the command service point"
);
return
-
1
;
return
-
1
;
...
...
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