From 948da791ada086333fcdc02dd3ab9f9349d34820 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 3 Jul 2019 17:51:00 +0300 Subject: [PATCH] Wrap calls to fsync with skip_eintr. GitOrigin-RevId: c7eaba54794d461428cce064e51be26909f39a30 --- tdutils/td/utils/port/FileFd.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tdutils/td/utils/port/FileFd.cpp b/tdutils/td/utils/port/FileFd.cpp index 3b5f59cb..6f06820f 100644 --- a/tdutils/td/utils/port/FileFd.cpp +++ b/tdutils/td/utils/port/FileFd.cpp @@ -468,9 +468,9 @@ Status FileFd::sync() { CHECK(!empty()); #if TD_PORT_POSIX #if TD_DARWIN - if (fcntl(get_native_fd().fd(), F_FULLFSYNC) == -1) { + if (detail::skip_eintr([&] { return fcntl(get_native_fd().fd(), F_FULLFSYNC); }) == -1) { #else - if (fsync(get_native_fd().fd()) != 0) { + if (detail::skip_eintr([&] { return fsync(get_native_fd().fd()); }) != 0) { #endif #elif TD_PORT_WINDOWS if (FlushFileBuffers(get_native_fd().fd()) == 0) {