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
GitLab 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
84679e0c
Commit
84679e0c
authored
Oct 18, 2016
by
Alex March
Committed by
Damien George
Oct 19, 2016
Browse files
Options
Downloads
Patches
Plain Diff
extmod/vfs_fat_file: Check fatfs f_sync() and f_close() returns for errors.
parent
17ba6ef5
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
extmod/vfs_fat_file.c
+8
-2
8 additions, 2 deletions
extmod/vfs_fat_file.c
with
8 additions
and
2 deletions
extmod/vfs_fat_file.c
+
8
−
2
View file @
84679e0c
...
...
@@ -110,14 +110,20 @@ STATIC mp_uint_t file_obj_write(mp_obj_t self_in, const void *buf, mp_uint_t siz
STATIC
mp_obj_t
file_obj_flush
(
mp_obj_t
self_in
)
{
pyb_file_obj_t
*
self
=
MP_OBJ_TO_PTR
(
self_in
);
f_sync
(
&
self
->
fp
);
FRESULT
res
=
f_sync
(
&
self
->
fp
);
if
(
res
!=
FR_OK
)
{
mp_raise_OSError
(
fresult_to_errno_table
[
res
]);
}
return
mp_const_none
;
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_1
(
file_obj_flush_obj
,
file_obj_flush
);
STATIC
mp_obj_t
file_obj_close
(
mp_obj_t
self_in
)
{
pyb_file_obj_t
*
self
=
MP_OBJ_TO_PTR
(
self_in
);
f_close
(
&
self
->
fp
);
FRESULT
res
=
f_close
(
&
self
->
fp
);
if
(
res
!=
FR_OK
)
{
mp_raise_OSError
(
fresult_to_errno_table
[
res
]);
}
return
mp_const_none
;
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_1
(
file_obj_close_obj
,
file_obj_close
);
...
...
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