buftee
6 years agoHandle short writes. master
Emil Mikulic [Sun, 24 Mar 2013 18:17:32 +0000 (05:17 +1100)]
Handle short writes.

6 years agoFree memory, check queues are empty on exit.
Emil Mikulic [Sun, 24 Mar 2013 17:44:37 +0000 (04:44 +1100)]
Free memory, check queues are empty on exit.

6 years agoReduce warnings.
Emil Mikulic [Sun, 24 Mar 2013 17:36:26 +0000 (04:36 +1100)]
Reduce warnings.

6 years agoDrain writers after SIGTERM.
Emil Mikulic [Sun, 24 Mar 2013 17:32:28 +0000 (04:32 +1100)]
Drain writers after SIGTERM.

6 years agoInclude line and function name in nblog() output.
Emil Mikulic [Sun, 24 Mar 2013 14:28:50 +0000 (01:28 +1100)]
Include line and function name in nblog() output.

6 years agoUse a separate thread for logging to stderr.
Emil Mikulic [Sun, 24 Mar 2013 14:16:47 +0000 (01:16 +1100)]
Use a separate thread for logging to stderr.

6 years agoFirst cut at test.
Emil Mikulic [Sun, 24 Mar 2013 09:42:04 +0000 (20:42 +1100)]
First cut at test.

6 years agoMove shared mutex and cond from global to per-writer.
Emil Mikulic [Sun, 24 Mar 2013 08:26:55 +0000 (19:26 +1100)]
Move shared mutex and cond from global to per-writer.

6 years agoMake STDERR nonblocking again after SIGCONT.
Emil Mikulic [Sun, 10 Mar 2013 17:06:01 +0000 (04:06 +1100)]
Make STDERR nonblocking again after SIGCONT.

Without this, flow control on the tty can block execution if we
were stopped and continued.

6 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.

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

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

6 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.

6 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().

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

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