chiark / gitweb /
fds: Make many fds nonblocking
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 27 Sep 2014 12:56:35 +0000 (13:56 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 2 Oct 2014 15:40:17 +0000 (16:40 +0100)
commit73a3388dc9349d2cf97db482192ab6a76e377f26
tree43326273f0bab2dcb78dee50033c76ac96d2d302
parent6550c51d2ea6cc73ad2c65c8f96c8b4a3585ca1b
fds: Make many fds nonblocking

Introduce iswouldblock to cope with POSIX not specifying which of
EAGAIN or EWOULDBLOCK you get).  In various subsystems, make more fds
nonblocking and handle errors appropriately.  Specifically:

* Logging self-pipe reading end.
* Signal self-pipe reading end.
* SLIP both ends.  Fixing the writing end involves breaking out
  a new function slip_write.
* tun's network interface fd.

In various of these we add code to handle EINTR, too.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
log.c
process.c
slip.c
tun.c
util.h