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
7cb6d1b0
Unverified
Commit
7cb6d1b0
authored
Jul 05, 2018
by
Stéphane Graber
Committed by
GitHub
Jul 05, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2451 from brauner/2018-07-06/bugfixes
bugfixes
parents
5e64d01b
57b1ab60
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
12 deletions
+13
-12
commands.c
src/lxc/commands.c
+2
-2
network.c
src/lxc/network.c
+3
-3
nl.c
src/lxc/nl.c
+1
-1
start.c
src/lxc/start.c
+7
-6
No files found.
src/lxc/commands.c
View file @
7cb6d1b0
...
@@ -206,7 +206,7 @@ static int lxc_cmd_rsp_send(int fd, struct lxc_cmd_rsp *rsp)
...
@@ -206,7 +206,7 @@ static int lxc_cmd_rsp_send(int fd, struct lxc_cmd_rsp *rsp)
{
{
ssize_t
ret
;
ssize_t
ret
;
ret
=
send
(
fd
,
rsp
,
sizeof
(
*
rsp
),
0
);
ret
=
send
(
fd
,
rsp
,
sizeof
(
*
rsp
),
MSG_NOSIGNAL
);
if
(
ret
<
0
||
(
size_t
)
ret
!=
sizeof
(
*
rsp
))
{
if
(
ret
<
0
||
(
size_t
)
ret
!=
sizeof
(
*
rsp
))
{
SYSERROR
(
"Failed to send command response %zd"
,
ret
);
SYSERROR
(
"Failed to send command response %zd"
,
ret
);
return
-
1
;
return
-
1
;
...
@@ -215,7 +215,7 @@ static int lxc_cmd_rsp_send(int fd, struct lxc_cmd_rsp *rsp)
...
@@ -215,7 +215,7 @@ static int lxc_cmd_rsp_send(int fd, struct lxc_cmd_rsp *rsp)
if
(
!
rsp
->
data
||
rsp
->
datalen
<=
0
)
if
(
!
rsp
->
data
||
rsp
->
datalen
<=
0
)
return
0
;
return
0
;
ret
=
send
(
fd
,
rsp
->
data
,
rsp
->
datalen
,
0
);
ret
=
send
(
fd
,
rsp
->
data
,
rsp
->
datalen
,
MSG_NOSIGNAL
);
if
(
ret
<
0
||
ret
!=
(
ssize_t
)
rsp
->
datalen
)
{
if
(
ret
<
0
||
ret
!=
(
ssize_t
)
rsp
->
datalen
)
{
SYSWARN
(
"Failed to send command response data %zd"
,
ret
);
SYSWARN
(
"Failed to send command response data %zd"
,
ret
);
return
-
1
;
return
-
1
;
...
...
src/lxc/network.c
View file @
7cb6d1b0
...
@@ -3094,7 +3094,7 @@ int lxc_network_send_veth_names_to_child(struct lxc_handler *handler)
...
@@ -3094,7 +3094,7 @@ int lxc_network_send_veth_names_to_child(struct lxc_handler *handler)
if
(
netdev
->
type
!=
LXC_NET_VETH
)
if
(
netdev
->
type
!=
LXC_NET_VETH
)
continue
;
continue
;
ret
=
send
(
data_sock
,
netdev
->
name
,
IFNAMSIZ
,
0
);
ret
=
send
(
data_sock
,
netdev
->
name
,
IFNAMSIZ
,
MSG_NOSIGNAL
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
-
1
;
return
-
1
;
TRACE
(
"Sent network device name
\"
%s
\"
to child"
,
netdev
->
name
);
TRACE
(
"Sent network device name
\"
%s
\"
to child"
,
netdev
->
name
);
...
@@ -3142,14 +3142,14 @@ int lxc_network_send_name_and_ifindex_to_parent(struct lxc_handler *handler)
...
@@ -3142,14 +3142,14 @@ int lxc_network_send_name_and_ifindex_to_parent(struct lxc_handler *handler)
struct
lxc_netdev
*
netdev
=
iterator
->
elem
;
struct
lxc_netdev
*
netdev
=
iterator
->
elem
;
/* Send network device name in the child's namespace to parent. */
/* Send network device name in the child's namespace to parent. */
ret
=
send
(
data_sock
,
netdev
->
name
,
IFNAMSIZ
,
0
);
ret
=
send
(
data_sock
,
netdev
->
name
,
IFNAMSIZ
,
MSG_NOSIGNAL
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
-
1
;
return
-
1
;
/* Send network device ifindex in the child's namespace to
/* Send network device ifindex in the child's namespace to
* parent.
* parent.
*/
*/
ret
=
send
(
data_sock
,
&
netdev
->
ifindex
,
sizeof
(
netdev
->
ifindex
),
0
);
ret
=
send
(
data_sock
,
&
netdev
->
ifindex
,
sizeof
(
netdev
->
ifindex
),
MSG_NOSIGNAL
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
-
1
;
return
-
1
;
}
}
...
...
src/lxc/nl.c
View file @
7cb6d1b0
...
@@ -229,7 +229,7 @@ extern int netlink_send(struct nl_handler *handler, struct nlmsg *nlmsg)
...
@@ -229,7 +229,7 @@ extern int netlink_send(struct nl_handler *handler, struct nlmsg *nlmsg)
nladdr
.
nl_pid
=
0
;
nladdr
.
nl_pid
=
0
;
nladdr
.
nl_groups
=
0
;
nladdr
.
nl_groups
=
0
;
ret
=
sendmsg
(
handler
->
fd
,
&
msg
,
0
);
ret
=
sendmsg
(
handler
->
fd
,
&
msg
,
MSG_NOSIGNAL
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
-
errno
;
return
-
errno
;
...
...
src/lxc/start.c
View file @
7cb6d1b0
...
@@ -208,9 +208,9 @@ static bool lxc_try_preserve_namespaces(struct lxc_handler *handler,
...
@@ -208,9 +208,9 @@ static bool lxc_try_preserve_namespaces(struct lxc_handler *handler,
return
true
;
return
true
;
}
}
static
in
t
match_fd
(
int
fd
)
static
in
line
bool
match_stdfds
(
int
fd
)
{
{
return
(
fd
==
0
||
fd
==
1
||
fd
==
2
);
return
(
fd
==
STDIN_FILENO
||
fd
==
STDOUT_FILENO
||
fd
==
STDERR_FILENO
);
}
}
int
lxc_check_inherited
(
struct
lxc_conf
*
conf
,
bool
closeall
,
int
lxc_check_inherited
(
struct
lxc_conf
*
conf
,
bool
closeall
,
...
@@ -277,7 +277,7 @@ restart:
...
@@ -277,7 +277,7 @@ restart:
if
(
current_config
&&
fd
==
current_config
->
logfd
)
if
(
current_config
&&
fd
==
current_config
->
logfd
)
continue
;
continue
;
if
(
match_
fd
(
fd
))
if
(
match_
stdfds
(
fd
))
continue
;
continue
;
if
(
closeall
)
{
if
(
closeall
)
{
...
@@ -301,9 +301,10 @@ restart:
...
@@ -301,9 +301,10 @@ restart:
static
int
setup_signal_fd
(
sigset_t
*
oldmask
)
static
int
setup_signal_fd
(
sigset_t
*
oldmask
)
{
{
int
ret
,
sig
;
int
ret
;
int
sig
;
sigset_t
mask
;
sigset_t
mask
;
int
signals
[]
=
{
SIGBUS
,
SIGILL
,
SIGSEGV
,
SIGWINCH
};
const
int
signals
[]
=
{
SIGBUS
,
SIGILL
,
SIGSEGV
,
SIGWINCH
};
/* Block everything except serious error signals. */
/* Block everything except serious error signals. */
ret
=
sigfillset
(
&
mask
);
ret
=
sigfillset
(
&
mask
);
...
@@ -451,7 +452,7 @@ int lxc_serve_state_clients(const char *name, struct lxc_handler *handler,
...
@@ -451,7 +452,7 @@ int lxc_serve_state_clients(const char *name, struct lxc_handler *handler,
lxc_state2str
(
state
),
client
->
clientfd
);
lxc_state2str
(
state
),
client
->
clientfd
);
again:
again:
ret
=
send
(
client
->
clientfd
,
&
msg
,
sizeof
(
msg
),
0
);
ret
=
send
(
client
->
clientfd
,
&
msg
,
sizeof
(
msg
),
MSG_NOSIGNAL
);
if
(
ret
<=
0
)
{
if
(
ret
<=
0
)
{
if
(
errno
==
EINTR
)
{
if
(
errno
==
EINTR
)
{
TRACE
(
"Caught EINTR; retrying"
);
TRACE
(
"Caught EINTR; retrying"
);
...
...
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