You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by rb...@covalent.net on 2001/02/23 11:36:30 UTC

Re: cvs commit: apr/file_io/unix mktemp.c

On 23 Feb 2001 trawick@apache.org wrote:

> trawick     01/02/23 10:35:43
>
>   Modified:    file_io/unix mktemp.c
>   Log:
>   fix for ReliantUNIX and other platforms with no mkstemp() routine:
>
>   Don't rename mkstemp(); locks/unix/crossproc.c assumes that mkstemp() is the
>   name of the function.

I believe this goes the wrong way.  Go ahead and rename mkstemp.  Change
the locking code to use the corrent apr_mkstemp, instead of the system
one.

We should not be exporting symbols from apr that are not namespace
protected, even if those functions are supposed to be provided by the
system.

Ryan

>
>   Don't provide mkstemps(), mkdtemp(), or mktemp().
>
>   Submitted by:	jean-frederic clere <jf...@fujitsu-siemens.com>
>   Mangled by:	Jeff Trawick
>
>   Revision  Changes    Path
>   1.3       +4 -4      apr/file_io/unix/mktemp.c
>
>   Index: mktemp.c
>   ===================================================================
>   RCS file: /home/cvs/apr/file_io/unix/mktemp.c,v
>   retrieving revision 1.2
>   retrieving revision 1.3
>   diff -u -r1.2 -r1.3
>   --- mktemp.c	2001/02/21 18:51:14	1.2
>   +++ mktemp.c	2001/02/23 18:35:42	1.3
>   @@ -48,10 +48,6 @@
>    #define seedrandom(a) srandom(a)
>    #endif
>    #define _open(a,b,c) open(a,b,c)
>   -#define mkdtemp ap_mkdtemp
>   -#define mkstemp ap_mkstemp
>   -#define mkstemps ap_mkstemps
>   -#define mktemp ap_mktemp
>
>    #if defined(LIBC_SCCS) && !defined(lint)
>    #if 0
>   @@ -84,6 +80,7 @@
>    "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
>    static uint32_t randseed=0;
>
>   +#ifdef APR_STARTS_USING_IT
>    int
>    mkstemps(path, slen)
>    	char *path;
>   @@ -93,6 +90,7 @@
>
>    	return (_gettemp(path, &fd, 0, slen) ? fd : -1);
>    }
>   +#endif /* APR_STARTS_USING_IT */
>
>    int
>    mkstemp(path)
>   @@ -103,6 +101,7 @@
>    	return (_gettemp(path, &fd, 0, 0) ? fd : -1);
>    }
>
>   +#ifdef APR_STARTS_USING_IT
>    char *
>    mkdtemp(path)
>    	char *path;
>   @@ -126,6 +125,7 @@
>    {
>    	return(_mktemp(path));
>    }
>   +#endif /* APR_STARTS_USING_IT */
>
>    static int
>    _gettemp(path, doopen, domkdir, slen)
>
>
>
>
>


_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


Re: cvs commit: apr/file_io/unix mktemp.c

Posted by Jeff Trawick <tr...@bellsouth.net>.
Jeff Trawick <tr...@bellsouth.net> writes:

> Okey dokey.  APR will formally provide apr_mkstemp() to apps, with
> prototype/doc in apr_file_io.h.

Boy am I scatterbrained today :(  I take back what I said :)

I'll namespace protect it, but it won't be formally provided by APR as
an API.  It doesn't have an appropriate interface for APR (returning
an int file descriptor?), though it does have an appropriate interface
for the lock code.

If/when APR has an API to create a temp file (not a bad idea), it
should probably use apr_mkstemp() on Unix.

-- 
Jeff Trawick | trawickj@bellsouth.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...

Re: cvs commit: apr/file_io/unix mktemp.c

Posted by Jeff Trawick <tr...@bellsouth.net>.
rbb@covalent.net writes:

> On 23 Feb 2001 trawick@apache.org wrote:
> 
> > trawick     01/02/23 10:35:43
> >
> >   Modified:    file_io/unix mktemp.c
> >   Log:
> >   fix for ReliantUNIX and other platforms with no mkstemp() routine:
> >
> >   Don't rename mkstemp(); locks/unix/crossproc.c assumes that mkstemp() is the
> >   name of the function.
> 
> I believe this goes the wrong way.  Go ahead and rename mkstemp.  Change
> the locking code to use the corrent apr_mkstemp, instead of the system
> one.

Okey dokey.  APR will formally provide apr_mkstemp() to apps, with
prototype/doc in apr_file_io.h.

> We should not be exporting symbols from apr that are not namespace
> protected, even if those functions are supposed to be provided by the
> system.

yeah, I know :)  I just wasn't ready (personally) to say that APR
provides a mkstemp() function.  I'm over it.

-- 
Jeff Trawick | trawickj@bellsouth.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...