diff options
-rw-r--r-- | torch/lib/c10d/Utils.hpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/torch/lib/c10d/Utils.hpp b/torch/lib/c10d/Utils.hpp index 06e6738458..752d8e4bc6 100644 --- a/torch/lib/c10d/Utils.hpp +++ b/torch/lib/c10d/Utils.hpp @@ -291,9 +291,11 @@ using SizeType = uint64_t; #define SYSCHECK(expr) \ { \ - errno = 0; \ - auto ___output = (expr); \ - (void)___output; \ + do { \ + errno = 0; \ + auto ___output = (expr); \ + (void)___output; \ + } while (errno == EINTR); \ if (errno != 0) \ throw std::system_error(errno, std::system_category()); \ } |