configurator: Print test source without cat
authorKevin Locke <kevin@kevinlocke.name>
Thu, 29 Sep 2016 00:44:44 +0000 (18:44 -0600)
committerDavid Gibson <david@gibson.dropbear.id.au>
Fri, 30 Sep 2016 03:51:27 +0000 (13:51 +1000)
commitfcdcba92fe85ced9594cabb9c1f960dc98e33077
treec67017d72ec961327408a1f7b19ce82397c5adb4
parent888660c3c11f15331e8a06a0e492d48650b2680f
configurator: Print test source without cat

Windows does not provide cat.  Instead, copy the test source to stdout
using the file stream to which it was written.

Changes since v1:
- Create fwrite_noeintr to avoid EINTR in fwrite without writing any
  data.
- Handle short reads from fread.  This can happen with non-conformant
  libc or if EINTR occurs after reading some data.
- Handle short writes from fwrite.  This can happen with non-conformant
  libc or if EINTR occurs after writing some data.

Changes since v2:
- Revert fwrite_noeintr and short read/write changes.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
tools/configurator/configurator.c