Re: [PATCH 1/1] vreportf(): avoid buffered write in favor of unbuffered one
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Oct 29, 2019, 14:18 UTC
- Message-ID
- <nycvar.QRO.7.76.6.1910291514090.46@tvgsbejvaqbjf.bet>
- In-Reply-To
- <20191029135221.GB2843@sigill.intra.peff.net>
Hi Peff,
On Tue, 29 Oct 2019, Jeff King wrote:
Show 18 quoted lines
> On Tue, Oct 29, 2019 at 01:38:49PM +0100, Johannes Schindelin wrote: > > > > > Let's avoid this predicament altogether by rendering the entire message, > > > > including the prefix and the trailing newline, into the buffer we > > > > already have (and which is still fixed size) and then write it out via > > > > `write_in_full()`. > > > > > > s/write_in_full/xwrite/ perhaps? Both the cover letter and the patch > > > below use xwrite(). > > > > Excellent eyes! I had originally used `write_in_full()` before realizing > > that `xwrite()` would be more appropriate. > > What's your reasoning there? We wouldn't expect xwrite() to ever return > with a partial write. But if it did for whatever reason, surely we'd > prefer to keep trying to print the rest of the error rather than leave > it truncated? We might see an error on the subsequent write(), but it's > worth calling it to find out, I'd think.
Oh, `xwrite()` does not write in full, eh? But at least it continues on `EINTR`...
Will fix. Dscho