From 12387ab6f77d6ae4fa3d8fdc1756d416a27197dd Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Wed, 12 Aug 2009 18:22:38 +0000 Subject: 2009=08-12 Jeff Johnston * libc/stdio/mktemp.c (_gettemp): Do not call _mkdir_r unless HAVE_MKDIR is defined. 2009-08-12 Hans-Peter Nilsson * 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. --- newlib/libc/stdio/mktemp.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'newlib/libc/stdio/mktemp.c') 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 */ -- cgit v1.2.3