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
870a288c
Unverified
Commit
870a288c
authored
Feb 24, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commands: tweak return values
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
f3aca94f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
commands.c
src/lxc/commands.c
+3
-3
No files found.
src/lxc/commands.c
View file @
870a288c
...
...
@@ -180,7 +180,7 @@ static int lxc_cmd_rsp_recv(int sock, struct lxc_cmd_rr *cmd)
rspdata
=
malloc
(
sizeof
(
*
rspdata
));
if
(
!
rspdata
)
return
syserrno_set
(
-
ENOMEM
,
"Failed to receive response for command
\"
%s
\"
"
,
cur_cmdstr
);
return
syserrno_set
(
fret
?:
-
ENOMEM
,
"Failed to receive response for command
\"
%s
\"
"
,
cur_cmdstr
);
rspdata
->
ptxfd
=
move_fd
(
fds
->
fd
[
0
]);
rspdata
->
ttynum
=
PTR_TO_INT
(
rsp
->
data
);
...
...
@@ -215,7 +215,7 @@ static int lxc_cmd_rsp_recv(int sock, struct lxc_cmd_rr *cmd)
if
((
rsp
->
datalen
>
LXC_CMD_DATA_MAX
)
&&
(
cur_cmd
!=
LXC_CMD_CONSOLE_LOG
))
return
syserrno_set
(
-
E2BIG
,
"Response data for command
\"
%s
\"
is too long: %d bytes > %d"
,
return
syserrno_set
(
fret
?:
-
E2BIG
,
"Response data for command
\"
%s
\"
is too long: %d bytes > %d"
,
cur_cmdstr
,
rsp
->
datalen
,
LXC_CMD_DATA_MAX
);
if
(
cur_cmd
==
LXC_CMD_CONSOLE_LOG
)
...
...
@@ -223,7 +223,7 @@ static int lxc_cmd_rsp_recv(int sock, struct lxc_cmd_rr *cmd)
else
if
(
cur_cmd
!=
LXC_CMD_GET_CGROUP_CTX
)
rsp
->
data
=
malloc
(
rsp
->
datalen
);
if
(
!
rsp
->
data
)
return
syserrno_set
(
-
ENOMEM
,
"Failed to allocate response buffer for command
\"
%s
\"
"
,
cur_cmdstr
);
return
syserrno_set
(
fret
?:
-
ENOMEM
,
"Failed to allocate response buffer for command
\"
%s
\"
"
,
cur_cmdstr
);
ret
=
lxc_recv_nointr
(
sock
,
rsp
->
data
,
rsp
->
datalen
,
0
);
if
(
ret
!=
rsp
->
datalen
)
...
...
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