buftee
11 years agoHandle write() returning EAGAIN by sleeping and retrying.
Emil Mikulic [Sun, 10 Mar 2013 16:57:56 +0000 (03:57 +1100)]
Handle write() returning EAGAIN by sleeping and retrying.

Before this change, flow control on the tty caused the entire
program to exit.  After the change, we survive fine, and continue to
write to other file descriptors while the tty is blocked.

11 years agoDead code: remove max().
Emil Mikulic [Sun, 10 Mar 2013 16:45:41 +0000 (03:45 +1100)]
Dead code: remove max().

11 years agoReduce locking in writer_routine().
Emil Mikulic [Sun, 10 Mar 2013 16:45:24 +0000 (03:45 +1100)]
Reduce locking in writer_routine().

11 years agoCleanly handle select() returning EINTR.
Emil Mikulic [Sun, 10 Mar 2013 17:23:34 +0000 (04:23 +1100)]
Cleanly handle select() returning EINTR.

This is usually the result of catching SIGTERM (via ^C).
After this change, we exit cleanly.

11 years agoShow TID instead of PID in warn_time().
Emil Mikulic [Sun, 10 Mar 2013 17:23:14 +0000 (04:23 +1100)]
Show TID instead of PID in warn_time().

11 years agoAdd clang sanitized build.
Emil Mikulic [Sun, 10 Mar 2013 16:34:21 +0000 (03:34 +1100)]
Add clang sanitized build.

11 years agoInitial revision.
Emil Mikulic [Sun, 10 Mar 2013 17:14:23 +0000 (04:14 +1100)]
Initial revision.