Re: [PATCH 07/11] apply: remove `newfd` from `struct apply_state`
- From
Jeff King <peff@peff.net>
- Date
- Oct 2, 2017, 05:50 UTC
- Message-ID
- <20171002055058.uue7uajfqtkntxjg@sigill.intra.peff.net>
- In-Reply-To
- <cede314e90ece6e4168634f5469f6c6f9883e375.1506862824.git.martin.agren@gmail.com>
On Sun, Oct 01, 2017 at 04:56:08PM +0200, Martin Ågren wrote:
Show 6 quoted lines
> Similar to a previous patch, we do not need to use `newfd` to signal > that we have a lockfile to clean up. We can just unconditionally call > `rollback_lock_file`. If we do not hold the lock, it will be a no-op. > > Where we check `newfd` to decide whether we need to take the lock, we > can instead use `is_lock_file_locked()`.
Looks good. I was surprised you didn't have to replace any writing to "newfd". But the writing it all happens via write_locked_index(), which directly accesses the lock's fd member.
-Peff