You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by "Schock, Johannes - NIVUS GmbH" <Jo...@nivus.com> on 2020/07/31 13:46:14 UTC
Some questions related PR#1478
Hello,
I have two questions related PR#1478 (https://github.com/apache/incubator-nuttx/pull/1478):
1. I think there's a configuration error with "Build / macOS (sim)" since it is using -Wempty-body, or is this intentional?
It gives errors for
for (namelen = 0; dirinfo->fd_lfname[namelen] != '\0'; namelen++);
2. Is there a way to flush a fat file system? Because I think the unexpected behaviour I've seen was related to debugging and fat cache flush.
I tried to use fsync on the folder (which was proposed in a linux related discussion), but open on a folder returns errno 21 (is a directory).
Regards, Johannes
Re: Some questions related PR#1478
Posted by Nathan Hartman <ha...@gmail.com>.
On Fri, Jul 31, 2020 at 9:46 AM Schock, Johannes - NIVUS GmbH <
Johannes.Schock@nivus.com> wrote:
> Hello,
> I have two questions related PR#1478 (
> https://github.com/apache/incubator-nuttx/pull/1478):
>
> 1. I think there's a configuration error with "Build / macOS (sim)" since
> it is using -Wempty-body, or is this intentional?
> It gives errors for
> for (namelen = 0; dirinfo->fd_lfname[namelen] != '\0'; namelen++);
That's asking for trouble...
We should probably keep the warning and fix that code to read:
for (.....)
{
}
Maybe even put a /* Do nothing */ comment in the body.
RE: Some questions related PR#1478
Posted by "Schock, Johannes - NIVUS GmbH" <Jo...@nivus.com>.
> From: Gregory Nutt [mailto:spudaneco@gmail.com]
> fsync on any open file descriptor will flush the file system since data
> is only buffered for for metadata and one file at a time.
This explains why my problem seems gone after I introduced a fsync on the file in my test case.
I will have another look and will then reopen the PR, I think.
Johannes
Re: Some questions related PR#1478
Posted by Gregory Nutt <sp...@gmail.com>.
> 2. Is there a way to flush a fat file system? Because I think the unexpected behaviour I've seen was related to debugging and fat cache flush.
> I tried to use fsync on the folder (which was proposed in a linux related discussion), but open on a folder returns errno 21 (is a directory).
fsync on any open file descriptor will flush the file system since data
is only buffered for for metadata and one file at a time. All syncs's
are the same for the FAT file system.