Re: [PATCH 2/4] sideband: reverse its dependency on pkt-line
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Jan 15, 2019, 18:38 UTC
- Message-ID
- <20190115183807.255640-1-jonathantanmy@google.com>
- In-Reply-To
- <xmqqlg3mubxt.fsf@gitster-ct.c.googlers.com>
Show 16 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
> > Lack of corresponding comment bothers readers. In all of
> > REMOTE_ERROR, PROGRESS and PROTOCOL_ERROR cases, the other helper
> > stuffs the message in outbuf in "switch (band) { ... }" and writes
> > it out with xwrite(2, outbuf.buf, outbuf.len) [*1*], so I can see
> > there is no need for us to write anything out here. Perhaps
> >
> > case SIDEBAND_FLUSH:
> > default: /* errors: message already written */
> > return retval;
> >
> > or something to clarify?
>
> Forgot a footnote for *1* above. I was wondering if xwrite is what
> we really want, rather than write_in_full().There is an existing comment explaining this:
* The output is accumulated in a buffer and * each line is printed to stderr using * write(2) to ensure inter-process atomicity.
which seems reasonable to me (I know that write(2) does not guarantee to write everything, but write_in_full() does not guarantee atomicity, as far as I know).