Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
558fd5d2
Commit
558fd5d2
authored
8 years ago
by
Paul Sokolovsky
Browse files
Options
Downloads
Patches
Plain Diff
py/stream: ioctl(): Properly support 2-arg form.
parent
6c3db26a
No related branches found
Branches containing commit
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
py/stream.c
+8
-6
8 additions, 6 deletions
py/stream.c
with
8 additions
and
6 deletions
py/stream.c
+
8
−
6
View file @
558fd5d2
...
...
@@ -414,12 +414,14 @@ 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
;
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
);
val
=
(
uintptr_t
)
bufinfo
.
buf
;
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_WRITE
);
val
=
(
uintptr_t
)
bufinfo
.
buf
;
}
}
int
error
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment