Gracefully handle EINTR during read.

EINTR should be retried.
This commit is contained in:
Simon Bucher 2026-08-19 10:46:41 +00:00
parent fc6433bbae
commit b98d7b6853
1 changed files with 4 additions and 1 deletions

View File

@ -1194,7 +1194,10 @@ bool read_until_abc_done(abc_output_filter &filt, int fd, DeferredLogs &logs) {
bool seen_source_cmd = false; bool seen_source_cmd = false;
bool seen_yosys_abc_done = false; bool seen_yosys_abc_done = false;
while (true) { while (true) {
int ret = read(fd, buf, sizeof(buf) - 1); int ret;
do {
ret = read(fd, buf, sizeof(buf) - 1);
} while (ret == -1 && errno == EINTR);
if (ret < 0) { if (ret < 0) {
logs.log_error("Failed to read from ABC, errno=%d\n", errno); logs.log_error("Failed to read from ABC, errno=%d\n", errno);
return false; return false;