Thread (45 messages) flat view 45 messages, 4 authors, 2017-09-15

Re: [PATCH 5/7] pkt-line: check write_in_full() errors against "< 0"

From: Jonathan Nieder <hidden>
Date: 2017-09-13 21:17:49

Jeff King wrote:
As with the previous two commits, we prefer to check
write_in_full()'s return value to see if it is negative,
rather than comparing it to the input length.

These cases actually flip the logic to check for success,
making conversion a little different than in other cases. We
could of course write:

  if (write_in_full(...) >= 0)
          return 0;
 return error(...);

But our usual method of spelling write() error checks is
just "< 0". So let's flip the logic for each of these
conditionals to our usual style.

Signed-off-by: Jeff King <redacted>
---
 pkt-line.c | 29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)
Reviewed-by: Jonathan Nieder <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help