diff options
Diffstat (limited to 'newlib/libc/stdio/fopencookie.c')
-rw-r--r-- | newlib/libc/stdio/fopencookie.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/newlib/libc/stdio/fopencookie.c b/newlib/libc/stdio/fopencookie.c index 0861528..ab406a8 100644 --- a/newlib/libc/stdio/fopencookie.c +++ b/newlib/libc/stdio/fopencookie.c @@ -107,7 +107,7 @@ fcreader (struct _reent *ptr, fccookie *c = (fccookie *) cookie; errno = 0; if ((result = c->readfn (c->cookie, buf, n)) < 0 && errno) - ptr->_errno = errno; + _REENT_ERRNO(ptr) = errno; return result; } @@ -129,7 +129,7 @@ fcwriter (struct _reent *ptr, } errno = 0; if ((result = c->writefn (c->cookie, buf, n)) < 0 && errno) - ptr->_errno = errno; + _REENT_ERRNO(ptr) = errno; return result; } @@ -148,11 +148,11 @@ fcseeker (struct _reent *ptr, errno = 0; if (c->seekfn (c->cookie, &offset, whence) < 0 && errno) - ptr->_errno = errno; + _REENT_ERRNO(ptr) = errno; #ifdef __LARGE64_FILES else if ((_fpos_t)offset != offset) { - ptr->_errno = EOVERFLOW; + _REENT_ERRNO(ptr) = EOVERFLOW; offset = -1; } #endif /* __LARGE64_FILES */ @@ -170,7 +170,7 @@ fcseeker64 (struct _reent *ptr, fccookie *c = (fccookie *) cookie; errno = 0; if (c->seekfn (c->cookie, &offset, whence) < 0 && errno) - ptr->_errno = errno; + _REENT_ERRNO(ptr) = errno; return (_fpos64_t) offset; } #endif /* __LARGE64_FILES */ @@ -185,7 +185,7 @@ fccloser (struct _reent *ptr, { errno = 0; if ((result = c->closefn (c->cookie)) < 0 && errno) - ptr->_errno = errno; + _REENT_ERRNO(ptr) = errno; } _free_r (ptr, c); return result; @@ -207,7 +207,7 @@ _fopencookie_r (struct _reent *ptr, if (((flags & (__SRD | __SRW)) && !functions.read) || ((flags & (__SWR | __SRW)) && !functions.write)) { - ptr->_errno = EINVAL; + _REENT_ERRNO(ptr) = EINVAL; return NULL; } if ((fp = __sfp (ptr)) == NULL) |