Re: [PATCH] close clobbers mmap's errno in read_cache
- From
- Sven Verdoolaege <skimo@kotnet.org>
- Date
- Oct 7, 2005, 21:48 UTC
- Message-ID
- <20051007214845.GH8383MdfPADPa@greensroom.kotnet.org>
- In-Reply-To
- <20051007214551.GA8893@steel.home>
On Fri, Oct 07, 2005 at 11:45:51PM +0200, Alex Riesen wrote:
Show 7 quoted lines
> }
> + 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 ? There's no point in closing if you're going to die.
skimo