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

Re: [PATCH] bundle, fast-import: detect write failure

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 10, 2008, 12:05 UTC
Message-ID
<alpine.LSU.1.00.0801101204120.31053@racer.site>
In-Reply-To
<874pdmhxha.fsf@rho.meyering.net>
Hi,
On Thu, 10 Jan 2008, Jim Meyering wrote:
> I noticed some unchecked writes.  This fixes them.
Thank you.
However, you also have this:
> -	close(keep_fd);
> +	if (close(keep_fd))
> +		die("failed to write keep file");

I recently read an article which got me thinking about close(). The author maintained that many mistakes are done by being overzealously defensive; die()ing in case of a close() failure (when open() succeeded!) might be just wrong.

Ciao, Dscho

Previous: Pierre HabouzitNext: Jim Meyering
Message 3 of 13 in “bundle, fast-import: detect write failure”
  1. bundle, fast-import: detect write failureJim Meyering, Jan 10, 2008
  2. Pierre HabouzitJan 10, 2008
  3. Johannes SchindelinJan 10, 2008
  4. Jim MeyeringJan 10, 2008
  5. Johannes SchindelinJan 10, 2008
  6. Jim MeyeringJan 10, 2008
  7. Pierre HabouzitJan 10, 2008
  8. Jim MeyeringJan 10, 2008
  9. Pierre HabouzitJan 10, 2008
  10. Jakub NarebskiJan 11, 2008
  11. Junio C HamanoJan 11, 2008
  12. David TweedJan 11, 2008
  13. Johannes SchindelinJan 11, 2008

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.