Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
698a6a9d
Commit
698a6a9d
authored
Nov 29, 2015
by
Paul Sokolovsky
Browse files
unix/moduselect: poll.register(): Reuse freed entries in poll array.
parent
19920e25
Changes
1
Hide whitespace changes
Inline
Side-by-side
unix/moduselect.c
View file @
698a6a9d
...
...
@@ -58,7 +58,15 @@ STATIC mp_obj_t poll_register(uint n_args, const mp_obj_t *args) {
if
(
self
->
len
<
self
->
alloc
)
{
i
=
self
->
len
++
;
}
else
{
assert
(
0
);
struct
pollfd
*
entries
=
self
->
entries
;
for
(
i
=
0
;
i
<
self
->
len
;
i
++
,
entries
++
)
{
if
(
entries
->
fd
==
-
1
)
{
break
;
}
}
if
(
entries
->
fd
!=
-
1
)
{
assert
(
0
);
}
}
self
->
entries
[
i
].
fd
=
mp_obj_get_int
(
args
[
1
]);
...
...
Write
Preview
Supports
Markdown
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