From 135b55aa99ca7f37fd23ce48bec64fe1d69498bf Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 22 Nov 2009 17:26:51 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1318 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/various/syscalls.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'os/various') 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; -- cgit v1.2.3