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
85e9c763
Unverified
Commit
85e9c763
authored
Mar 10, 2020
by
Stéphane Graber
Committed by
GitHub
Mar 10, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3286 from brauner/2020-03-10/fixes
commands: make sure to always close the client fd
parents
c2250e75
cd5369b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
commands.c
src/lxc/commands.c
+6
-6
No files found.
src/lxc/commands.c
View file @
85e9c763
...
@@ -1327,8 +1327,7 @@ static void lxc_cmd_fd_cleanup(int fd, struct lxc_handler *handler,
...
@@ -1327,8 +1327,7 @@ static void lxc_cmd_fd_cleanup(int fd, struct lxc_handler *handler,
lxc_terminal_free
(
handler
->
conf
,
fd
);
lxc_terminal_free
(
handler
->
conf
,
fd
);
lxc_mainloop_del_handler
(
descr
,
fd
);
lxc_mainloop_del_handler
(
descr
,
fd
);
switch
(
cmd
)
{
if
(
cmd
==
LXC_CMD_ADD_STATE_CLIENT
)
{
case
LXC_CMD_ADD_STATE_CLIENT
:
lxc_list_for_each_safe
(
cur
,
&
handler
->
conf
->
state_clients
,
next
)
{
lxc_list_for_each_safe
(
cur
,
&
handler
->
conf
->
state_clients
,
next
)
{
struct
lxc_state_client
*
client
=
cur
->
elem
;
struct
lxc_state_client
*
client
=
cur
->
elem
;
...
@@ -1344,7 +1343,8 @@ static void lxc_cmd_fd_cleanup(int fd, struct lxc_handler *handler,
...
@@ -1344,7 +1343,8 @@ static void lxc_cmd_fd_cleanup(int fd, struct lxc_handler *handler,
* No need to walk the whole list. If we found the state
* No need to walk the whole list. If we found the state
* client fd there can't be a second one.
* client fd there can't be a second one.
*/
*/
break
;
TRACE
(
"Closed state client fd %d
\n
"
,
fd
);
return
;
}
}
/*
/*
...
@@ -1353,10 +1353,10 @@ static void lxc_cmd_fd_cleanup(int fd, struct lxc_handler *handler,
...
@@ -1353,10 +1353,10 @@ static void lxc_cmd_fd_cleanup(int fd, struct lxc_handler *handler,
* was already reached by the time we were ready to add it. So
* was already reached by the time we were ready to add it. So
* fallthrough and clean it up.
* fallthrough and clean it up.
*/
*/
__fallthrough
;
TRACE
(
"Closing state client fd %d not present in state client list
\n
"
,
fd
);
default:
close
(
fd
);
}
}
close
(
fd
);
}
}
static
int
lxc_cmd_handler
(
int
fd
,
uint32_t
events
,
void
*
data
,
static
int
lxc_cmd_handler
(
int
fd
,
uint32_t
events
,
void
*
data
,
...
...
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