Re: [PATCH 07/10] unix-socket: create gentle version of unix_stream_listen()
- From
Chris Torek <chris.torek@gmail.com>
- Date
- Jan 14, 2021, 01:19 UTC
- Message-ID
- <CAPx1GvcpmLJzSpO9J4u8t+ZZ+MdZuVuJ2gPHP5ei0xng3cV9oQ@mail.gmail.com>
- In-Reply-To
- <X/7+YU16XrPFDYlN@coredump.intra.peff.net>
I had saved this to comment on, but Peff beat me to it :-)
On Wed, Jan 13, 2021 at 6:07 AM Jeff King <peff@peff.net> wrote:
> There might be a solution using link() to have an atomic winner, but it > gets tricky around unlinking the old name out of the way.
You definitely should be able to do this atomically with link(), but the cleanup is indeed messy, and there's already existing locking code, so it's probably better to press that into service here.
Chris