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

Re: [PATCH] close clobbers mmap's errno in read_cache

From
Alex Riesen <raa.lkml@gmail.com>
Date
Oct 7, 2005, 23:50 UTC
Message-ID
<20051007235011.GA8189@steel.home>
In-Reply-To
<20051007214845.GH8383MdfPADPa@greensroom.kotnet.org>
Sven Verdoolaege, Fri, Oct 07, 2005 23:48:45 +0200:
Show 10 quoted lines
> On Fri, Oct 07, 2005 at 11:45:51PM +0200, Alex Riesen wrote:
> >  	}
> > +	i = errno;
> >  	close(fd);
> >  	if (map == MAP_FAILED)
> > -		die("index file mmap failed (%s)", strerror(errno));
> > +		die("index file mmap failed (%s)", strerror(i));
> >  
> 
> Why don't you just move the close after the test ?
I don't know.
> There's no point in closing if you're going to die.
> 
> skimo
Of course you're right :) I'm just blind after eight.
Previous: Sven Verdoolaege
Message 3 of 3 in “close clobbers mmap's errno in read_cache”
  1. close clobbers mmap's errno in read_cacheAlex Riesen, Oct 7, 2005
  2. Sven VerdoolaegeOct 7, 2005
  3. Alex RiesenOct 7, 2005

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.