Re: [PATCH 1/2] prefer xwrite instead of write

2014-01-17 Thread Jonathan Nieder
Junio C Hamano wrote: > Jonathan Nieder writes: >> Shouldn't this use write_in_full() to avoid a silently truncated result? (*) > > Meaning this? If so, I think it makes sense. [...] > - if (xwrite(fd, out.buf, out.len) < 0) > + if (write_in_full(fd, out.buf, out.len) != out.len) Yes.

Re: [PATCH 1/2] prefer xwrite instead of write

2014-01-17 Thread Junio C Hamano
Jonathan Nieder writes: > Junio C Hamano wrote: >> Jonathan Nieder writes: > >>> Shouldn't this use write_in_full() to avoid a silently truncated result? (*) >> >> Meaning this? If so, I think it makes sense. > [...] >> -if (xwrite(fd, out.buf, out.len) < 0) >> +if (write_in_full(fd, ou

Re: [PATCH 1/2] prefer xwrite instead of write

2014-01-17 Thread Erik Faye-Lund
On Fri, Jan 17, 2014 at 8:07 PM, Junio C Hamano wrote: > Jonathan Nieder writes: > >> Hi, >> >> Erik Faye-Lund wrote: >> >>> --- a/builtin/merge.c >>> +++ b/builtin/merge.c >>> @@ -367,7 +367,7 @@ static void squash_message(struct commit *commit, >>> struct commit_list *remotehead >>>

Re: [PATCH 1/2] prefer xwrite instead of write

2014-01-17 Thread Junio C Hamano
Jonathan Nieder writes: > Hi, > > Erik Faye-Lund wrote: > >> --- a/builtin/merge.c >> +++ b/builtin/merge.c >> @@ -367,7 +367,7 @@ static void squash_message(struct commit *commit, struct >> commit_list *remotehead >> sha1_to_hex(commit->object.sha1)); >> pretty

Re: [PATCH 1/2] prefer xwrite instead of write

2014-01-17 Thread Jonathan Nieder
Hi, Erik Faye-Lund wrote: > --- a/builtin/merge.c > +++ b/builtin/merge.c > @@ -367,7 +367,7 @@ static void squash_message(struct commit *commit, struct > commit_list *remotehead > sha1_to_hex(commit->object.sha1)); > pretty_print_commit(&ctx, commit, &out); >