Re: [RFC PATCH] midx.c: clean up .rev file
- From
- Xiaowen Xia <haoyurenzhuxia@gmail.com>
- Date
- Jun 27, 2022, 03:53 UTC
- Message-ID
- <CAHLXgnYeR_Mwp3A31_q-T_cWw75F1jFAKrVsvm8R04Z-VaWz3A@mail.gmail.com>
- In-Reply-To
- <220622.86a6a4lmdv.gmgdl@evledraar.gmail.com>
Thanks for your attention.
> Is the rest of this API thread safe, and no longer is because of this? > You're doing this because...
* The `gettext()` and `fputs()` which calls in `die_errno(_())` are seem highly unlikely async-signal-safety, this may cause problems in signal handlers, I should remove it. * This is thread-safe. The *.rev file will no longer be read/written after creating the signal handler by `sigchain_push_common()`. * On the other hand, the command: `git multi-pack-index write --bitmap` will create an lockfile named `multi-pack-index.lock` and the signal handler will not affect the execution of the same command or git-process.
The purpose of this patch is the same as what Teng Long said, to clean up the files generated by the process when the process exits abnormally.
Thanks.