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
7fbb15ec
Unverified
Commit
7fbb15ec
authored
Sep 03, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tree-wide: s/send()/lxc_send_nointr()/g
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
28143f88
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
15 deletions
+13
-15
commands.c
src/lxc/commands.c
+7
-3
network.c
src/lxc/network.c
+3
-3
start.c
src/lxc/start.c
+3
-9
No files found.
src/lxc/commands.c
View file @
7fbb15ec
...
@@ -206,7 +206,8 @@ static int lxc_cmd_rsp_send(int fd, struct lxc_cmd_rsp *rsp)
...
@@ -206,7 +206,8 @@ 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
),
MSG_NOSIGNAL
);
errno
=
EMSGSIZE
;
ret
=
lxc_send_nointr
(
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 +216,8 @@ static int lxc_cmd_rsp_send(int fd, struct lxc_cmd_rsp *rsp)
...
@@ -215,7 +216,8 @@ 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
,
MSG_NOSIGNAL
);
errno
=
EMSGSIZE
;
ret
=
lxc_send_nointr
(
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
;
...
@@ -242,7 +244,9 @@ static int lxc_cmd_send(const char *name, struct lxc_cmd_rr *cmd,
...
@@ -242,7 +244,9 @@ static int lxc_cmd_send(const char *name, struct lxc_cmd_rr *cmd,
if
(
cmd
->
req
.
datalen
<=
0
)
if
(
cmd
->
req
.
datalen
<=
0
)
return
client_fd
;
return
client_fd
;
ret
=
send
(
client_fd
,
cmd
->
req
.
data
,
cmd
->
req
.
datalen
,
MSG_NOSIGNAL
);
errno
=
EMSGSIZE
;
ret
=
lxc_send_nointr
(
client_fd
,
(
void
*
)
cmd
->
req
.
data
,
cmd
->
req
.
datalen
,
MSG_NOSIGNAL
);
if
(
ret
<
0
||
ret
!=
(
ssize_t
)
cmd
->
req
.
datalen
)
if
(
ret
<
0
||
ret
!=
(
ssize_t
)
cmd
->
req
.
datalen
)
goto
on_error
;
goto
on_error
;
...
...
src/lxc/network.c
View file @
7fbb15ec
...
@@ -3057,7 +3057,7 @@ int lxc_network_send_veth_names_to_child(struct lxc_handler *handler)
...
@@ -3057,7 +3057,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
,
MSG_NOSIGNAL
);
ret
=
lxc_send_nointr
(
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
);
...
@@ -3105,14 +3105,14 @@ int lxc_network_send_name_and_ifindex_to_parent(struct lxc_handler *handler)
...
@@ -3105,14 +3105,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
,
MSG_NOSIGNAL
);
ret
=
lxc_send_nointr
(
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
),
MSG_NOSIGNAL
);
ret
=
lxc_send_nointr
(
data_sock
,
&
netdev
->
ifindex
,
sizeof
(
netdev
->
ifindex
),
MSG_NOSIGNAL
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
-
1
;
return
-
1
;
}
}
...
...
src/lxc/start.c
View file @
7fbb15ec
...
@@ -61,6 +61,7 @@
...
@@ -61,6 +61,7 @@
#include "conf.h"
#include "conf.h"
#include "confile_utils.h"
#include "confile_utils.h"
#include "error.h"
#include "error.h"
#include "file_utils.h"
#include "list.h"
#include "list.h"
#include "lsm/lsm.h"
#include "lsm/lsm.h"
#include "log.h"
#include "log.h"
...
@@ -440,16 +441,9 @@ int lxc_serve_state_clients(const char *name, struct lxc_handler *handler,
...
@@ -440,16 +441,9 @@ int lxc_serve_state_clients(const char *name, struct lxc_handler *handler,
TRACE
(
"Sending state %s to state client %d"
,
TRACE
(
"Sending state %s to state client %d"
,
lxc_state2str
(
state
),
client
->
clientfd
);
lxc_state2str
(
state
),
client
->
clientfd
);
again:
ret
=
lxc_send_nointr
(
client
->
clientfd
,
&
msg
,
sizeof
(
msg
),
MSG_NOSIGNAL
);
ret
=
send
(
client
->
clientfd
,
&
msg
,
sizeof
(
msg
),
MSG_NOSIGNAL
);
if
(
ret
<=
0
)
if
(
ret
<=
0
)
{
if
(
errno
==
EINTR
)
{
TRACE
(
"Caught EINTR; retrying"
);
goto
again
;
}
SYSERROR
(
"Failed to send message to client"
);
SYSERROR
(
"Failed to send message to client"
);
}
/* kick client from list */
/* kick client from list */
lxc_list_del
(
cur
);
lxc_list_del
(
cur
);
...
...
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