summaryrefslogtreecommitdiffstats
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.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/newlib/libc/stdio/mktemp.c b/newlib/libc/stdio/mktemp.c
index 167ee9b0f..185d9df35 100644
--- a/newlib/libc/stdio/mktemp.c
+++ b/newlib/libc/stdio/mktemp.c
@@ -201,10 +201,15 @@ _DEFUN(_gettemp, (ptr, path, doopen, domkdir, suffixlen),
#if !defined _ELIX_LEVEL || _ELIX_LEVEL >= 4
if (domkdir)
{
+#ifdef HAVE_MKDIR
if (_mkdir_r (ptr, path, 0700) == 0)
return 1;
if (ptr->_errno != EEXIST)
return 0;
+#else /* !HAVE_MKDIR */
+ ptr->_errno = ENOSYS;
+ return 0;
+#endif /* !HAVE_MKDIR */
}
else
#endif /* _ELIX_LEVEL */