[Rsync-patches] [PATCH] Give a meaningful error message when we fail to write to a batch file.

Matt McCutchen <matt at mattmccutchen.net>
Mon Mar 9 10:10:57 PDT 2009


On Mon, 2009-03-09 at 08:01 -0700, Wayne Davison wrote:
> On Sat, Jan 31, 2009 at 01:14:17AM -0500, Matt McCutchen wrote:
> > -	if (fd == write_batch_monitor_out) {
> > -		if ((size_t)write(batch_fd, buf, len) != len)
> > -			exit_cleanup(RERR_FILEIO);
> > -	}
> > +	if (fd == write_batch_monitor_out)
> > +		writefd_unbuffered(batch_fd, buf, len);
> 
> This part concerned me, making me wonder if it would cause problems or
> not; e.g. if it might try to read more data when writing the batch file.
> However, I forgot to look into the issue.  Have you checked if msg_fd_in
> is always < 0 when using that to write the batch file?  It should always
> be -1 in the receiver (since it's primary use is in the generator), but
> the sender uses it during the file-list transfer phase too.

Gosh, I don't know.  (You're the one who's supposed to understand the
I/O code, not me.)  But I don't see how this call to writefd_unbuffered
would be any more harmful than the immediately following one that
actually sends the data to the other process.

-- 
Matt




More information about the rsync-patches mailing list