On 11/09/2009 02:14 PM, s...@apache.org wrote:
> Author: sf
> Date: Mon Nov  9 13:14:07 2009
> New Revision: 834049
> 
> URL: http://svn.apache.org/viewvc?rev=834049&view=rev
> Log:
> Make PUT with DAV_MODE_WRITE_TRUNC create a temporary file first and, when the
> transfer has been completed successfully, move it over the old file.
> 
> Since this would break inode keyed locking, switch to filename keyed locking
> exclusively.
> 
> PR: 39815
> Submitted by: Paul Querna, Stefan Fritsch
> 
> Modified:
>     httpd/httpd/trunk/CHANGES
>     httpd/httpd/trunk/modules/dav/fs/lock.c
>     httpd/httpd/trunk/modules/dav/fs/repos.c
> 

> Modified: httpd/httpd/trunk/modules/dav/fs/repos.c
> URL: 
> http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/dav/fs/repos.c?rev=834049&r1=834048&r2=834049&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/dav/fs/repos.c (original)
> +++ httpd/httpd/trunk/modules/dav/fs/repos.c Mon Nov  9 13:14:07 2009
                                     dav_stream **stream)
> @@ -876,7 +890,19 @@
>  
>      ds->p = p;
>      ds->pathname = resource->info->pathname;
> -    rv = apr_file_open(&ds->f, ds->pathname, flags, APR_OS_DEFAULT, ds->p);
> +    ds->temppath = NULL;
> +
> +    if (mode == DAV_MODE_WRITE_TRUNC) {
> +        ds->temppath = apr_pstrcat(p, ap_make_dirstr_parent(p, ds->pathname),
> +                                   DAV_FS_TMP_PREFIX "XXXXXX", NULL);
> +        rv = apr_file_mktemp(&ds->f, ds->temppath, flags, ds->p);

This causes the following warning:

repos.c: In function 'dav_fs_open_stream':
repos.c:900: warning: passing argument 2 of 'apr_file_mktemp' discards 
qualifiers from pointer target type


Regards

RĂ¼diger

Reply via email to