All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"René Scharfe" <l.s.r@web.de>,
	"Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH 1/2] pack-objects: use BUG(...) not die("BUG: ...")
Date: Mon,  6 Dec 2021 17:25:20 +0100	[thread overview]
Message-ID: <patch-1.2-2a17ed9f135-20211206T162442Z-avarab@gmail.com> (raw)
In-Reply-To: <cover-0.2-00000000000-20211206T162442Z-avarab@gmail.com>

Change this code added in da93d12b004 (pack-objects: be incredibly
anal about stdio semantics, 2006-04-02) to use BUG() instead.

See 1a07e59c3e2 (Update messages in preparation for i18n, 2018-07-21)
for when the "BUG: " prefix was added, and [1] for background on the
Solaris behavior that prompted the exhaustive error checking in this
fgets() loop.

1. https://lore.kernel.org/git/824.1144007555@lotus.CS.Berkeley.EDU/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/pack-objects.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 857be7826f3..b36ed828d8d 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -3397,7 +3397,7 @@ static void read_object_list_from_stdin(void)
 			if (feof(stdin))
 				break;
 			if (!ferror(stdin))
-				die("BUG: fgets returned NULL, not EOF, not error!");
+				BUG("fgets returned NULL, not EOF, not error!");
 			if (errno != EINTR)
 				die_errno("fgets");
 			clearerr(stdin);
-- 
2.34.1.898.g5a552c2e5f0


  reply	other threads:[~2021-12-06 16:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-06 16:25 [PATCH 0/2] replace die("BUG: ...") with BUG("...") Ævar Arnfjörð Bjarmason
2021-12-06 16:25 ` Ævar Arnfjörð Bjarmason [this message]
2021-12-06 16:25 ` [PATCH 2/2] strbuf.h: use BUG(...) not die("BUG: ...") Ævar Arnfjörð Bjarmason
2021-12-06 18:44 ` [PATCH 0/2] replace die("BUG: ...") with BUG("...") Junio C Hamano
2021-12-07 11:00   ` Ævar Arnfjörð Bjarmason
2021-12-07  0:24 ` [PATCH 3/2] " Junio C Hamano
2021-12-07 11:05 ` [PATCH v2 0/4] " Ævar Arnfjörð Bjarmason
2021-12-07 11:05   ` [PATCH v2 1/4] pack-objects: use BUG(...) not die("BUG: ...") Ævar Arnfjörð Bjarmason
2021-12-07 11:05   ` [PATCH v2 2/4] strbuf.h: " Ævar Arnfjörð Bjarmason
2021-12-07 11:05   ` [PATCH v2 3/4] pathspec: use BUG(...) not die("BUG:%s:%d....", <file>, <line>) Ævar Arnfjörð Bjarmason
2021-12-07 11:05   ` [PATCH v2 4/4] object.h: use BUG(...) no die("BUG: ...") in lookup_object_by_type() Ævar Arnfjörð Bjarmason

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=patch-1.2-2a17ed9f135-20211206T162442Z-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=l.s.r@web.de \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.