Lars Schneider writes:
>> So the "right" pattern is either:
>>
>> 1. Return -1 and the caller is responsible for telling the user.
>>
... which is valid only if there aren't different kinds of errors
that all return -1; with "return error(...)" with different
> On 15 Sep 2016, at 21:44, Jeff King wrote:
>
> On Thu, Sep 15, 2016 at 05:42:58PM +0100, Lars Schneider wrote:
>
>> +int packet_flush_gently(int fd)
>> +{
>> +packet_trace("", 4, 1);
>> +if (write_in_full(fd, "", 4) == 4)
>> +
On Thu, Sep 15, 2016 at 05:42:58PM +0100, Lars Schneider wrote:
> +int packet_flush_gently(int fd)
> +{
> +packet_trace("", 4, 1);
> +if (write_in_full(fd, "", 4) == 4)
> +return 0;
> +error("flush packet write
> On 13 Sep 2016, at 23:44, Junio C Hamano wrote:
>
> Lars Schneider writes:
>
>>> On 13 Sep 2016, at 00:30, Junio C Hamano wrote:
>>>
>>> larsxschnei...@gmail.com writes:
>>>
From: Lars Schneider
Lars Schneider writes:
>> On 13 Sep 2016, at 00:30, Junio C Hamano wrote:
>>
>> larsxschnei...@gmail.com writes:
>>
>>> From: Lars Schneider
>>>
>>> packet_flush() would die in case of a write error even though for some
> On 13 Sep 2016, at 00:30, Junio C Hamano wrote:
>
> larsxschnei...@gmail.com writes:
>
>> From: Lars Schneider
>>
>> packet_flush() would die in case of a write error even though for some
>> callers an error would be acceptable. Add
larsxschnei...@gmail.com writes:
> From: Lars Schneider
>
> packet_flush() would die in case of a write error even though for some
> callers an error would be acceptable. Add packet_flush_gently() which
> writes a pkt-line flush packet and returns `0` for success and
From: Lars Schneider
packet_flush() would die in case of a write error even though for some
callers an error would be acceptable. Add packet_flush_gently() which
writes a pkt-line flush packet and returns `0` for success and `-1` for
failure.
Signed-off-by: Lars
8 matches
Mail list logo