Skip to content

Commit 251505e

Browse files
committed
arch/sim/src/sim/posix/sim_hostfs.c: use host_errno_to_nx
tested with ELOOP, which is 62 on macOS and 40 on NuttX, on sim/macOS. ```shell spacetanuki% ln -s a a spacetanuki% cat a cat: a: Too many levels of symbolic links spacetanuki% ./nuttx NuttShell (NSH) NuttX-10.4.0 nsh> mount -t hostfs -o fs=. /mnt nsh> cat /mnt/a nsh: cat: open failed: 40 nsh> ``` this is a follow-up of #15552 this fixes a non-linux regression in #15535 Signed-off-by: YAMAMOTO Takashi <[email protected]>
1 parent 693508c commit 251505e

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

arch/sim/src/sim/posix/sim_hostfs.c

+3-6
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include <errno.h>
3838

3939
#include "hostfs.h"
40+
#include "sim_hosterrno.h"
4041

4142
/****************************************************************************
4243
* Private Functions
@@ -46,13 +47,9 @@
4647
* Name: host_errno_convert
4748
****************************************************************************/
4849

49-
static int host_errno_convert(int errcode)
50+
static int host_errno_convert(int negative_host_errno)
5051
{
51-
/* Provide a common interface, which should have different conversions
52-
* on different platforms.
53-
*/
54-
55-
return errcode;
52+
return -host_errno_to_nx(-negative_host_errno, EIO);
5653
}
5754

5855
/****************************************************************************

0 commit comments

Comments
 (0)