git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] remove unnecessary test and dead diagnostic

From
Jim Meyering <jim@meyering.net>
Date
May 26, 2011, 13:59 UTC
Message-ID
<87tych5zrh.fsf@rho.meyering.net>
* sha1_file.c (index_stream): Don't check for size_t < 0.
read_in_full does not return an indication of failure.
Signed-off-by: Jim Meyering <meyering@redhat.com>
---
 sha1_file.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/sha1_file.c b/sha1_file.c
index 5fc877f..ea4549c 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -2736,8 +2736,6 @@ static int index_stream(unsigned char *sha1, int fd, size_t size,
 		size_t actual;

 		actual = read_in_full(fd, buf, sz);
-		if (actual < 0)
-			die_errno("index-stream: reading input");
 		if (write_in_full(fast_import.in, buf, actual) != actual)
 			die_errno("index-stream: feeding fast-import");
 		size -= actual;
--
1.7.5.2.660.g9f46c
Next: Jeff King
Message 1 of 10 in “remove unnecessary test and dead diagnostic”
  1. remove unnecessary test and dead diagnosticJim Meyering, May 26, 2011
  2. Jeff KingMay 26, 2011
  3. Jim MeyeringMay 26, 2011
  4. Jeff KingMay 26, 2011
  5. Jim MeyeringMay 26, 2011
  6. read_in_full: always report errorsJeff King, May 26, 2011
  7. Junio C HamanoMay 26, 2011
  8. Jeff KingMay 26, 2011
  9. Junio C HamanoMay 26, 2011
  10. Jeff KingMay 26, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.