aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc/stdio/mktemp.c
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdio/mktemp.c')
-rw-r--r--newlib/libc/stdio/mktemp.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/newlib/libc/stdio/mktemp.c b/newlib/libc/stdio/mktemp.c
index 3514818..2659681 100644
--- a/newlib/libc/stdio/mktemp.c
+++ b/newlib/libc/stdio/mktemp.c
@@ -159,7 +159,7 @@ _gettemp (struct _reent *ptr,
continue;
if (trv - path < suffixlen)
{
- ptr->_errno = EINVAL;
+ _REENT_ERRNO(ptr) = EINVAL;
return 0;
}
trv -= suffixlen;
@@ -171,7 +171,7 @@ _gettemp (struct _reent *ptr,
}
if (end - trv < 6)
{
- ptr->_errno = EINVAL;
+ _REENT_ERRNO(ptr) = EINVAL;
return 0;
}
@@ -195,7 +195,7 @@ _gettemp (struct _reent *ptr,
return (0);
if (!(sbuf.st_mode & S_IFDIR))
{
- ptr->_errno = ENOTDIR;
+ _REENT_ERRNO(ptr) = ENOTDIR;
return (0);
}
*trv = '/';
@@ -211,10 +211,10 @@ _gettemp (struct _reent *ptr,
#ifdef HAVE_MKDIR
if (_mkdir_r (ptr, path, 0700) == 0)
return 1;
- if (ptr->_errno != EEXIST)
+ if (_REENT_ERRNO(ptr) != EEXIST)
return 0;
#else /* !HAVE_MKDIR */
- ptr->_errno = ENOSYS;
+ _REENT_ERRNO(ptr) = ENOSYS;
return 0;
#endif /* !HAVE_MKDIR */
}
@@ -225,7 +225,7 @@ _gettemp (struct _reent *ptr,
if ((*doopen = _open_r (ptr, path, O_CREAT | O_EXCL | O_RDWR | flags,
0600)) >= 0)
return 1;
- if (ptr->_errno != EEXIST)
+ if (_REENT_ERRNO(ptr) != EEXIST)
return 0;
}
#ifdef __USE_INTERNAL_STAT64
@@ -233,7 +233,7 @@ _gettemp (struct _reent *ptr,
#else
else if (_stat_r (ptr, path, &sbuf))
#endif
- return (ptr->_errno == ENOENT ? 1 : 0);
+ return (_REENT_ERRNO(ptr) == ENOENT ? 1 : 0);
/* tricky little algorithm for backward compatibility */
for (trv = start;;)