Thread (1 message) 1 message, 1 author, 2017-11-16

Re: [PATCH] config: avoid "write_in_full(fd, buf, len) != len" pattern

From: Junio C Hamano <hidden>
Date: 2017-11-16 05:29:18

Phillip Wood [off-list ref] writes:
From: Phillip Wood <redacted>

As explained in commit 06f46f237 (avoid "write_in_full(fd, buf, len)
!= len" pattern, 2017–09–13) the return value of write_in_full() is
either -1 or the requested number of bytes. As such comparing the
return value to an unsigned value such as strbuf.len will fail to
catch errors. Change the code to use the preferred '< 0' check.
Thanks, queued.  This seems to have come from 9a5abfc7 ("After
renaming a section, print any trailing variable definitions",
2009-07-24), which is rather ancient, but was made worse by getting
duplicated by 52d59cc6 ("branch: add a --copy (-c) option to go with
--move (-m)", 2017-06-18) recently.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help