diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-06-06 15:39:09 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-06-06 15:39:10 +0900 |
commit | 0481af98ba115ac055c95431110f4fdfa60ab171 (patch) | |
tree | 7b9bc724b214e61dbe2c595e08b9c78eeb2065d7 | |
parent | Git 2.32-rc3 (diff) | |
parent | fsync(): be prepared to see EINTR (diff) | |
download | tgif-0481af98ba115ac055c95431110f4fdfa60ab171.tar.xz |
Merge branch 'jc/fsync-can-fail-with-eintr'
Last minute portability fix.
* jc/fsync-can-fail-with-eintr:
fsync(): be prepared to see EINTR
-rw-r--r-- | write-or-die.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/write-or-die.c b/write-or-die.c index eab8c8d0b9..d33e68f6ab 100644 --- a/write-or-die.c +++ b/write-or-die.c @@ -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); } } |