CHROMIUM: test_util_common: Fix EINTR handling

Calls to fgets don't clear ferror or errno on success or EOF. Therefore
it is necessary to manually clear the error state after an EINTR to be
able to differentiate the success and failure cases on subsequent
iterations.

BUG=b:360841319, b:363206134
TEST=cros_run_unit_tests

Change-Id: I78cf3dadb3de456b0486143e1447847500729d06
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/upstart/+/5831922
Reviewed-by: Jie Jiang <[email protected]>
Tested-by: David Stevens <[email protected]>
Commit-Queue: David Stevens <[email protected]>
Owners-Override: David Stevens <[email protected]>
Auto-Submit: David Stevens <[email protected]>
Commit-Queue: Jie Jiang <[email protected]>
1 file changed