aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/monitor-fd.hh
AgeCommit message (Collapse)Author
2023-03-31Ensure all headers have `#pragma once` and are in API docsJohn Ericson
`///@file` makes them show up in the internal API dos. A tiny few were missing `#pragma once`.
2023-01-11MonitorFdHup: Make it work on macOS againEelco Dolstra
It appears that on current macOS versions, our use of poll() to detect client disconnects no longer works. As a workaround, poll() for POLLRDNORM, since this *will* wake up when the client has disconnected. The downside is that it also wakes up when input is available. So just sleep for a bit in that case. This means that on macOS, a client disconnect may take up to a second to be detected, but that's better than not being detected at all. Fixes #7584.
2018-02-14monitor-fds: Fix on macOS.Shea Levy
Fixes #1871.
2017-01-26Fix interrupt handlingEelco Dolstra
2014-12-14PedantryEelco Dolstra
2014-12-09Explicitly include required C headersMarko Durkovic
2014-07-24Use pthread_cancel instead of a signalEelco Dolstra
Signal handlers are process-wide, so sending SIGINT to the monitor thread will cause the normal SIGINT handler to run. This sets the isInterrupted flag, which is not what we want. So use pthread_cancel instead.
2014-07-24Fix bogus pass by referenceEelco Dolstra
http://hydra.nixos.org/build/12711659
2014-07-24More debuggingEelco Dolstra
2014-07-24Add some assertionsEelco Dolstra
2014-07-23nix-daemon: Use a thread instead of SIGPOLL to catch client disconnectsEelco Dolstra
The thread calls poll() to wait until a HUP (or other error event) happens on the client connection. If so, it sends SIGINT to the main thread, which is then cleaned up normally. This is much nicer than messing around with SIGPOLL.