This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: [RFA:] add _mkdir_r, fixing fallout from "add mkstemps, mkdtemp"
On Aug 12 14:30, Jeff Johnston wrote:
> Hans-Peter Nilsson wrote:
>>> Date: Wed, 12 Aug 2009 12:26:14 -0400
>>> From: Jeff Johnston
>>> Actually, I don't agree with this. The better way to handle this is
>>> to protect the code with HAVE_MKDIR and put in the libnosys logic
>>> directly if it is not provided.
>>> [...]
>> This would work for me, too...but IIUC the reent.h part of the
>> patch I posted would still be be needed.
>>
> Yes, that's correct. I have checked in your newlib pieces with my
> patch added to mktemp.c. There is no libnosys part required so that is
> left out. Let me know if I missed anything.
Where is the configure check for HAVE_MKDIR?
As is, the patch breaks (not only) Cygwin because HAVE_MKDIR is nowhere
configured. As a result, the code path for all targets will be the one
setting ptr->_errno to ENOSYS. How do we add a check for HAVE_MKDIR
for cross builds?
There's also a typo in the file in the name of the function mkdtemp:
Index: libc/stdio/mktemp.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/mktemp.c,v
retrieving revision 1.12
diff -u -p -r1.12 mktemp.c
--- libc/stdio/mktemp.c 12 Aug 2009 18:22:38 -0000 1.12
+++ libc/stdio/mktemp.c 12 Aug 2009 22:06:21 -0000
@@ -301,7 +301,7 @@ _DEFUN(mkstemp, (path),
# if !defined _ELIX_LEVEL || _ELIX_LEVEL >= 4
char *
-_DEFUN(mkdemp, (path),
+_DEFUN(mkdtemp, (path),
char *path)
{
return (_gettemp (_REENT, path, (int *) NULL, 1, 0) ? path : NULL);
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat