Skip to content

Commit

Permalink
sim/hostfs: bypass flag O_BINARY to host
Browse files Browse the repository at this point in the history
Signed-off-by: chao an <anchao@xiaomi.com>
  • Loading branch information
anchao committed Apr 11, 2023
1 parent a7fc261 commit 5367fbc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/sim/src/sim/posix/sim_hostfs.c
Expand Up @@ -191,6 +191,11 @@ int host_open(const char *pathname, int flags, nuttx_mode_t mode)
mapflags |= O_DIRECTORY;
}

if (flags & NUTTX_O_BINARY)
{
mapflags |= O_BINARY;
}

int ret = open(pathname, mapflags, mode);
if (ret == -1)
{
Expand Down
5 changes: 5 additions & 0 deletions arch/sim/src/sim/win/sim_hostfs.c
Expand Up @@ -120,6 +120,11 @@ int host_open(const char *pathname, int flags, nuttx_mode_t mode)
mapflags |= O_TRUNC;
}

if (flags & NUTTX_O_BINARY)
{
mapflags |= O_BINARY;
}

ret = _open(pathname, mapflags, mode);
if (ret == -1)
{
Expand Down

0 comments on commit 5367fbc

Please sign in to comment.