Commit ba8025f
newlib: correct signature of _open() for xtensa
Previously, in libc-hooks.c, the signature of `_open()` was as
shown below.
```cpp
int _open(const char *name, int mode);
```
This conflicted with the signature of `_open()` from newlib,
which is
```cpp
int _open(const char *name, int flags, ...);
```
Moreover, the mode and flags field were reversed, but only for
the Xtensa architecture due to the `_open_r()` hook that is
present in `libc-hooks.c`.
This manifested itself via a call to `fopen(file, "w+")`, where
the expected flags should include `O_CREAT | O_TRUNC`, or
`0x200 | 0x400`. Instead, the unexpected flags passed to the
underlying `zvfs_open()` call were `0x1b6`.
This change corrects the function signature and order of the
arguments.
Signed-off-by: Chris Friedt <[email protected]>1 parent 4d60f0a commit ba8025f
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | | - | |
| 242 | + | |
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| |||
518 | 518 | | |
519 | 519 | | |
520 | 520 | | |
521 | | - | |
| 521 | + | |
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
| |||
0 commit comments