diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2009-08-12 18:22:38 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2009-08-12 18:22:38 +0000 |
commit | 12387ab6f77d6ae4fa3d8fdc1756d416a27197dd (patch) | |
tree | 36dafe73c5a032c70c5a02b3be651175ffc268b3 /newlib/libc/stdio/mktemp.c | |
parent | a73a3f438bd75c84ab2f6eb2a27a9b5064b7af9c (diff) | |
download | cygnal-12387ab6f77d6ae4fa3d8fdc1756d416a27197dd.tar.gz cygnal-12387ab6f77d6ae4fa3d8fdc1756d416a27197dd.tar.bz2 cygnal-12387ab6f77d6ae4fa3d8fdc1756d416a27197dd.zip |
2009=08-12 Jeff Johnston <jjohnstn@redhat.com>
* libc/stdio/mktemp.c (_gettemp): Do not call _mkdir_r unless
HAVE_MKDIR is defined.
2009-08-12 Hans-Peter Nilsson <hp@axis.com>
* libc/include/reent.h: Add prototype and definition of _mkdir_r.
* libc/reent/Makefile.am (GENERAL_SOURCES): Add mkdirr.c.
(CHEWOUT_FILES): Add mkdirr.def.
* libc/reent/Makefile.in: Regenerate.
* libc/reent/mkdirr.c: New file.
Diffstat (limited to 'newlib/libc/stdio/mktemp.c')
-rw-r--r-- | newlib/libc/stdio/mktemp.c | 5 |
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 */ |