Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Miosix Kernel
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
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Avionics
Software Development
Miosix Kernel
Commits
319b209a
Commit
319b209a
authored
11 years ago
by
Terraneo Federico
Browse files
Options
Downloads
Patches
Plain Diff
Fixed bug that prevented creating new files on FAT32
parent
1433f723
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
miosix/filesystem/fat32/fat32.cpp
+12
-2
12 additions, 2 deletions
miosix/filesystem/fat32/fat32.cpp
with
12 additions
and
2 deletions
miosix/filesystem/fat32/fat32.cpp
+
12
−
2
View file @
319b209a
...
...
@@ -328,8 +328,13 @@ int Fat32Fs::open(intrusive_ref_ptr<FileBase>& file, StringPart& name,
flags
++
;
//To convert from O_RDONLY, O_WRONLY, ... to _FREAD, _FWRITE, ...
struct
stat
st
;
if
(
!
(
flags
&
_FWRITE
))
{
//Don't stat now if _FWRITE, the file may not yet exist as we may be
//asked to create it
if
(
int
result
=
lstat
(
name
,
&
st
))
return
result
;
if
(
!
S_ISDIR
(
st
.
st_mode
))
}
if
((
flags
&
_FWRITE
)
||
!
S_ISDIR
(
st
.
st_mode
))
{
//About to open a file
BYTE
openflags
=
0
;
...
...
@@ -343,6 +348,11 @@ int Fat32Fs::open(intrusive_ref_ptr<FileBase>& file, StringPart& name,
Lock
<
FastMutex
>
l
(
mutex
);
if
(
int
res
=
translateError
(
f_open
(
f
->
fil
(),
name
.
c_str
(),
openflags
)))
return
res
;
if
(
flags
&
_FWRITE
)
{
//If we didn't stat before, stat now to get the inode
if
(
int
result
=
lstat
(
name
,
&
st
))
return
result
;
}
f
->
setInode
(
st
.
st_ino
);
//Can't open files larger than INT_MAX
...
...
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