Problem
UnixSocketConnection.send calls POSIX write(2) without suppressing SIGPIPE. If the daemon closes between the connection check and the write, Darwin can terminate the app instead of returning an error.
Evidence: https://github.com/richardcase/clowder/blob/b5492d5/macos/Sources/ClowderCore/UnixSocketConnection.swift#L86-L100
Acceptance criteria
- Set
SO_NOSIGPIPE when creating the socket, or use an equivalent safe write path.
- Preserve clean
EPIPE/connection errors for callers.
- Add a test that closes the peer and verifies the process survives.
Problem
UnixSocketConnection.sendcalls POSIXwrite(2)without suppressing SIGPIPE. If the daemon closes between the connection check and the write, Darwin can terminate the app instead of returning an error.Evidence: https://github.com/richardcase/clowder/blob/b5492d5/macos/Sources/ClowderCore/UnixSocketConnection.swift#L86-L100
Acceptance criteria
SO_NOSIGPIPEwhen creating the socket, or use an equivalent safe write path.EPIPE/connection errors for callers.