Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
558fd5d2
Commit
558fd5d2
authored
Apr 10, 2016
by
Paul Sokolovsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py/stream: ioctl(): Properly support 2-arg form.
parent
6c3db26a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
py/stream.c
py/stream.c
+8
-6
No files found.
py/stream.c
View file @
558fd5d2
...
...
@@ -414,13 +414,15 @@ STATIC mp_obj_t stream_ioctl(size_t n_args, const mp_obj_t *args) {
const
mp_stream_p_t
*
stream_p
=
mp_get_stream_raise
(
args
[
0
],
MP_STREAM_OP_IOCTL
);
mp_buffer_info_t
bufinfo
;
uintptr_t
val
;
uintptr_t
val
=
0
;
if
(
n_args
>
2
)
{
if
(
MP_OBJ_IS_INT
(
args
[
2
]))
{
val
=
mp_obj_get_int
(
args
[
2
]);
}
else
{
mp_get_buffer_raise
(
args
[
2
],
&
bufinfo
,
MP_BUFFER_READ
);
mp_get_buffer_raise
(
args
[
2
],
&
bufinfo
,
MP_BUFFER_WRITE
);
val
=
(
uintptr_t
)
bufinfo
.
buf
;
}
}
int
error
;
mp_uint_t
res
=
stream_p
->
ioctl
(
args
[
0
],
mp_obj_get_int
(
args
[
1
]),
val
,
&
error
);
...
...
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