aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--os/various/syscalls.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/os/various/syscalls.c b/os/various/syscalls.c
index ccfda35d0..23bfea419 100644
--- a/os/various/syscalls.c
+++ b/os/various/syscalls.c
@@ -75,7 +75,7 @@ int _read_r(struct _reent *r, int file, char * ptr, int len)
(void)r;
#if defined(STDIN_SD)
if (!len || (file != 0)) {
- errno = EINVAL;
+ __errno_r(r) = EINVAL;
return -1;
}
*ptr++ = chIOGet(&STDOUT_SD);
@@ -86,7 +86,7 @@ int _read_r(struct _reent *r, int file, char * ptr, int len)
(void)file;
(void)ptr;
(void)len;
- errno = EINVAL;
+ __errno_r(r) = EINVAL;
return -1;
#endif
}
@@ -114,7 +114,7 @@ int _write_r(struct _reent *r, int file, char * ptr, int len)
(void)ptr;
#if defined(STDOUT_SD)
if (file != 1) {
- errno = EINVAL;
+ __errno_r(r) = EINVAL;
return -1;
}
n = len;
@@ -145,7 +145,7 @@ caddr_t _sbrk_r(struct _reent *r, int incr)
(void)r;
p = chCoreAlloc((size_t)incr);
if (p == NULL) {
- errno = ENOMEM;
+ __errno_r(r) = ENOMEM;
return (caddr_t)-1;
}
return (caddr_t)p;