aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc/stdio/tmpfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdio/tmpfile.c')
-rw-r--r--newlib/libc/stdio/tmpfile.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/newlib/libc/stdio/tmpfile.c b/newlib/libc/stdio/tmpfile.c
index f209a3e..5fe6e3b 100644
--- a/newlib/libc/stdio/tmpfile.c
+++ b/newlib/libc/stdio/tmpfile.c
@@ -65,15 +65,15 @@ _tmpfile_r (struct _reent *ptr)
fd = _open_r (ptr, f, O_RDWR | O_CREAT | O_EXCL | O_BINARY,
S_IRUSR | S_IWUSR);
}
- while (fd < 0 && ptr->_errno == EEXIST);
+ while (fd < 0 && _REENT_ERRNO(ptr) == EEXIST);
if (fd < 0)
return NULL;
fp = _fdopen_r (ptr, fd, "wb+");
- e = ptr->_errno;
+ e = _REENT_ERRNO(ptr);
if (!fp)
_close_r (ptr, fd);
(void) _remove_r (ptr, f);
- ptr->_errno = e;
+ _REENT_ERRNO(ptr) = e;
return fp;
}