]> git.99rst.org Git - git.git/commit
fsync(): be prepared to see EINTR
authorJunio C Hamano <redacted>
Fri, 4 Jun 2021 01:36:11 +0000 (10:36 +0900)
committerJunio C Hamano <redacted>
Sat, 5 Jun 2021 13:13:40 +0000 (22:13 +0900)
commitcccdfd22436ede80b37311e73a5c8339054a7ff1
tree1de394e2112a271deebf6413fdbbe44f524bd2c5
parent48bf2fa8bad054d66bd79c6ba903c89c704201f7
fsync(): be prepared to see EINTR

Some platforms, like NonStop do not automatically restart fsync()
when interrupted by a signal, even when that signal is setup with
SA_RESTART.

This can lead to test breakage, e.g., where "--progress" is used,
thus SIGALRM is sent often, and can interrupt an fsync() syscall.

Make sure we deal with such a case by retrying the syscall
ourselves.  Luckily, we call fsync() fron a single wrapper,
fsync_or_die(), so the fix is fairly isolated.

Reported-by: Randall S. Becker <redacted>
Helped-by: Jeff King <redacted>
Helped-by: Taylor Blau <redacted>
[jc: the above two did most of the work---I just tied the loose end]
Helped-by: René Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
write-or-die.c
git clone https://git.99rst.org/PROJECT