Re: [PATCH v2 05/12] checkout-index: simplify locking logic

2017-10-05 Thread Junio C Hamano
Martin Ågren writes: > `newfd` starts out negative. If we then take the lock, `newfd` will > become non-negative. We later check for exactly that property before > calling `write_locked_index()`. That is, we are simply using `newfd` as > a boolean to keep track of whether

[PATCH v2 05/12] checkout-index: simplify locking logic

2017-10-05 Thread Martin Ågren
`newfd` starts out negative. If we then take the lock, `newfd` will become non-negative. We later check for exactly that property before calling `write_locked_index()`. That is, we are simply using `newfd` as a boolean to keep track of whether we took the lock or not. (We always use `newfd` and