[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1505006 - in /subversion/trunk: ./ subversion/include/svn_io.h [2]

From: Stefan Fuhrmann <stefan.fuhrmann_at_wandisco.com>
Date: Sun, 21 Jul 2013 00:48:08 +0200

On Sat, Jul 20, 2013 at 12:11 AM, Bert Huijben <bert_at_qqmail.nl> wrote:

>
>
> > -----Original Message-----
> > From: stefan2_at_apache.org [mailto:stefan2_at_apache.org]
> > Sent: vrijdag 19 juli 2013 22:46
> > To: commits_at_subversion.apache.org
> > 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.
Received on 2013-07-21 00:48:40 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.