CHROMIUM: test_util_common: Handle fgets() errors, EINTR

In $BUG, we're seeing some failures were we get 0 lines of output from a
command where we expect *some* stdout. I suspect it may be an fgets()
error, where we're terminating the loop prematurely.

Similar to
https://chromium-review.googlesource.com/c/chromiumos/third_party/libnih/+/5696177
let's just retry if we're getting EINTR. For other errors, dump them so
we can see what's going on.

BUG=b:360841319
TEST=cros_run_unit_tests

Change-Id: I3bdc8c29c58639e030fd7525902f63014a38809f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/upstart/+/5826686
Tested-by: Brian Norris <[email protected]>
Commit-Queue: Gwendal Grignou <[email protected]>
Commit-Queue: Brian Norris <[email protected]>
Reviewed-by: Gwendal Grignou <[email protected]>
Auto-Submit: Brian Norris <[email protected]>
1 file changed