swtpm_setup: Add poll() after write() and before read() to detect errors

In case swtpm does not start properly the write() to it may work but
then the read() gets stuck. Detect a failed swtpm by adding a poll()
before the read(). Use some extended durations considering possibly
busy systems.

A terminating swtpm instance can be caused when an unacceptable
profile is passed.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
1 file changed