On Sat, Jul 20, 2013 at 12:11 AM, Bert Huijben <[email protected]> wrote:

>
>
> > -----Original Message-----
> > From: [email protected] [mailto:[email protected]]
> > Sent: vrijdag 19 juli 2013 22:46
> > To: [email protected]
> > Subject: svn commit: r1505006 - in /subversion/trunk: ./
> > subversion/include/svn_io.h subversion/libsvn_client/patch.c
> > subversion/libsvn_fs_fs/fs_fs.c subversion/libsvn_subr/io.c
> >
> > Author: stefan2
> > Date: Fri Jul 19 20:46:22 2013
> > New Revision: 1505006
> >
> > URL: http://svn.apache.org/r1505006
> > Log:
> > Merge revisions r1433848,1438408,1445080 from branches/fsfs-format7.
> > These introduce svn_io_file_create_empty and svn_io_file_create_binary
> > as alternatives to svn_io_file_create.
> >
> > A few conflicts had to be resolved.
>
> <snip>
> Second reply:
>
> >  {
> >    apr_file_t *f;
> >    apr_size_t written;
> > @@ -1178,16 +1179,28 @@ svn_error_t *svn_io_file_create(const ch
> >                             (APR_WRITE | APR_CREATE | APR_EXCL),
> >                             APR_OS_DEFAULT,
> >                             pool));
> > -  if (contents && *contents)
> > -    err = svn_io_file_write_full(f, contents, strlen(contents),
> > -                                 &written, pool);
> > -
> > +  if (length)
> > +    err = svn_io_file_write_full(f, contents, length, &written, pool);
> >
> >    return svn_error_trace(
> >                          svn_error_compose_create(err,
> >                                                   svn_io_file_close(f,
> pool)));
>
> Not really related to this patch,  but it is probably better to try to
> delete the new file when writing the initial data failed here.
>
> Otherwise we will just leave a file on disk where nobody will look after,
> because the user of this function can't really determine in which stage the
> create failed.
>

Thanks for implementing that.

-- Stefan^2.

Reply via email to