Skip to content

Commit

Permalink
Merge branch 'jc/fsync-can-fail-with-eintr'
Browse files Browse the repository at this point in the history
Last minute portability fix.

* jc/fsync-can-fail-with-eintr:
  fsync(): be prepared to see EINTR
  • Loading branch information
gitster committed Jun 6, 2021
2 parents c09b630 + cccdfd2 commit 0481af9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions write-or-die.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ void fprintf_or_die(FILE *f, const char *fmt, ...)

void fsync_or_die(int fd, const char *msg)
{
if (fsync(fd) < 0) {
die_errno("fsync error on '%s'", msg);
while (fsync(fd) < 0) {
if (errno != EINTR)
die_errno("fsync error on '%s'", msg);
}
}

Expand Down

0 comments on commit 0481af9

Please sign in to comment.