logwrapper: prevent logwrap from hanging when child dies

Sometimes the read on the PTY can wait indefinitely if the child
dies. By using a poll statement that monitors both the output
of the child and its state we prevent this from happening.

Change-Id: I51d5556c66f039bca673145ca72db262977e1689
2 files changed