summaryrefslogtreecommitdiff
path: root/include/llvm/Support/Errno.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Support/Errno.h')
-rw-r--r--include/llvm/Support/Errno.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/llvm/Support/Errno.h b/include/llvm/Support/Errno.h
index 35dc1ea7cf84..8069c3639df3 100644
--- a/include/llvm/Support/Errno.h
+++ b/include/llvm/Support/Errno.h
@@ -34,9 +34,10 @@ template <typename FailT, typename Fun, typename... Args>
inline auto RetryAfterSignal(const FailT &Fail, const Fun &F,
const Args &... As) -> decltype(F(As...)) {
decltype(F(As...)) Res;
- do
+ do {
+ errno = 0;
Res = F(As...);
- while (Res == Fail && errno == EINTR);
+ } while (Res == Fail && errno == EINTR);
return Res;
}