Skip to content

Commit 0481af9

Browse files
committed
Merge branch 'jc/fsync-can-fail-with-eintr'
Last minute portability fix. * jc/fsync-can-fail-with-eintr: fsync(): be prepared to see EINTR
2 parents c09b630 + cccdfd2 commit 0481af9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

write-or-die.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ void fprintf_or_die(FILE *f, const char *fmt, ...)
5757

5858
void fsync_or_die(int fd, const char *msg)
5959
{
60-
if (fsync(fd) < 0) {
61-
die_errno("fsync error on '%s'", msg);
60+
while (fsync(fd) < 0) {
61+
if (errno != EINTR)
62+
die_errno("fsync error on '%s'", msg);
6263
}
6364
}
6465

0 commit comments

Comments
 (0)