Skip to content

Commit bdbe453

Browse files
committed
Fix write_file to handle EINTR scenarios.
1 parent 0b5460b commit bdbe453

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/native/minipal/log.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,9 @@ static int sync_file(minipal_log_flags flags)
282282

283283
static ssize_t write_file(int fd, const char* msg, size_t bytes_to_write)
284284
{
285-
return write(fd, msg, bytes_to_write);
285+
ssize_t ret = 0;
286+
while ((ret = write(fd, msg, bytes_to_write)) < 0 && errno == EINTR);
287+
return ret;
286288
}
287289
#endif
288290

0 commit comments

Comments
 (0)