From: Junio C Hamano <gitster@pobox.com>
To: Phillip Wood <phillip.wood@talktalk.net>
Cc: Git Mailing List <git@vger.kernel.org>, Jeff King <peff@peff.net>,
Phillip Wood <phillip.wood@dunelm.org.uk>,
Sahil Dua <sahildua2305@gmail.com>
Subject: Re: [PATCH] config: avoid "write_in_full(fd, buf, len) != len" pattern
Date: Thu, 16 Nov 2017 14:29:09 +0900 [thread overview]
Message-ID: <xmqqo9o2x04a.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20171115124043.17147-1-phillip.wood@talktalk.net> (Phillip Wood's message of "Wed, 15 Nov 2017 12:40:43 +0000")
Phillip Wood <phillip.wood@talktalk.net> writes:
> From: Phillip Wood <phillip.wood@dunelm.org.uk>
>
> 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.
next prev parent reply other threads:[~2017-11-16 5:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-15 12:40 [PATCH] config: avoid "write_in_full(fd, buf, len) != len" pattern Phillip Wood
2017-11-16 5:29 ` Junio C Hamano [this message]
2017-11-17 22:06 ` Jeff King
2017-11-18 10:20 ` René Scharfe
2017-11-18 17:52 ` Jeff King
2017-11-18 20:25 ` René Scharfe
2017-11-18 11:27 ` Phillip Wood
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqo9o2x04a.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=phillip.wood@dunelm.org.uk \
--cc=phillip.wood@talktalk.net \
--cc=sahildua2305@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).