apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: cvs commit: apr/file_io/unix mktemp.c
Date Mon, 24 Sep 2001 07:41:04 GMT
On Mon, Sep 24, 2001 at 06:35:22AM -0000, rbb@apache.org wrote:
> rbb         01/09/23 23:35:22
> 
>   Modified:    .        apr.dsp
>                file_io/unix mktemp.c
>   Log:
>   Use the mktemp.c file from unix on Windows as well.  This requires
>   making it use APR functions.  This compiles cleanly, but I can't
>   easily test it on Windows.  I will check it out on Unix and test it
>   there in a few seconds.
>...
>   @@ -125,18 +128,18 @@
>    	for (;;) {
>    		errno = 0;
>    		if (doopen) {
>   -			if ((*doopen =
>   -			    _open(path, O_CREAT|O_EXCL|O_RDWR, 0600)) >= 0)
>   +			if ((rv = apr_file_open(&doopen, path, APR_CREATE|APR_EXCL|APR_READ|APR_WRITE,
>   +                                    0600, p)) == APR_SUCCESS)

Those perms are incorrect. The APR function takes different perms than the
Unix functions. That should be APR_UREAD|APR_UWRITE.

>    				return(1);
>    			if (errno != EEXIST)
>    				return(0);
>    		} else if (domkdir) {
>   -			if (mkdir(path, 0700) == 0)
>   +			if (apr_dir_make(path, 0700, p) == 0)

Similar problem here.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Mime
View raw message