From 71f1c7aaaf207e5fcaba951f4f0fc9da96e919ec Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Tue, 15 Jan 2019 13:57:13 +1100 Subject: [PATCH] my_fclose - retry on close fail like my_close my_close will retry closing for non-Windows platforms. As fclose exhibits the same return behavior, make it behave like my_close. --- mysys/my_fopen.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mysys/my_fopen.cc b/mysys/my_fopen.cc index c6f42215d1a..35521c60979 100644 --- a/mysys/my_fopen.cc +++ b/mysys/my_fopen.cc @@ -191,7 +191,10 @@ int my_fclose(FILE *fd, myf MyFlags) { mysql_mutex_lock(&THR_LOCK_open); file = my_fileno(fd); #ifndef _WIN32 - err = fclose(fd); + do + { + err = fclose(fd); + } while (err == -1 && errno == EINTR); #else err = my_win_fclose(fd); #endif