diff options
author | Moritz Angermann <moritz.angermann@gmail.com> | 2023-04-05 17:05:17 +0800 |
---|---|---|
committer | Moritz Angermann <moritz.angermann@gmail.com> | 2023-04-25 09:39:05 +0800 |
commit | 0e18254aa81b9315c13d6ae736cb38666d19f122 (patch) | |
tree | 60ed347dd4cbebd48cb7cb1dc9d4d34416f2d132 /src/libutil/closure.hh | |
parent | ef432b2b1502c73d505d8fdb487db529601fa4ab (diff) |
Fix shutdown behavior and resource management for recursive-nix on macOS
Previously, we relied on the `shutdown()` function to terminate `accept()`
calls on a listening socket. However, this approach did not work on macOS as
the waiting `accept()` call is not considered a connected socket, resulting in
an `ENOTCONN` error. Instead, we now close the listening socket to terminate
the `accept()` call.
Additionally, we fixed a resource management issue where we set the
`daemonSocket` variable to -1, triggering resource cleanup and causing the
`stopDaemon` function to be called twice. This resulted in errors as the socket
was already closed by the time the second `stopDaemon` call was made. Instead of
setting `daemonSocket` to -1, we now release the socket using the `release()`
method on a unique pointer. This properly transfers ownership and allows for
correct resource cleanup.
These changes ensure proper behavior and resource management for the
recursive-nix feature on macOS.
Diffstat (limited to 'src/libutil/closure.hh')
0 files changed, 0 insertions, 0 deletions