notification queue read -> readNoInt
authorShijin Kong <shikong@fb.com>
Tue, 8 Dec 2015 23:29:19 +0000 (15:29 -0800)
committerfacebook-github-bot-4 <folly-bot@fb.com>
Wed, 9 Dec 2015 02:20:20 +0000 (18:20 -0800)
Summary: EINTR should be retried

Reviewed By: afrind

Differential Revision: D2735879

fb-gh-sync-id: 6f25cd26e29ab8e7e13a3d63f24bf2d104c14809

folly/io/async/NotificationQueue.h

index 9eee132bc7b6b2063d1e2479eed59dd54b251b1f..4c2a31541772394ab0d7b027bb55dd6c4b9ee4e8 100644 (file)
@@ -27,6 +27,7 @@
 #include <stdexcept>
 #include <utility>
 
 #include <stdexcept>
 #include <utility>
 
+#include <folly/FileUtil.h>
 #include <folly/io/async/EventBase.h>
 #include <folly/io/async/EventHandler.h>
 #include <folly/io/async/DelayedDestruction.h>
 #include <folly/io/async/EventBase.h>
 #include <folly/io/async/EventHandler.h>
 #include <folly/io/async/DelayedDestruction.h>
@@ -502,10 +503,10 @@ class NotificationQueue {
     uint64_t value = 0;
     ssize_t rc = -1;
     if (eventfd_ >= 0) {
     uint64_t value = 0;
     ssize_t rc = -1;
     if (eventfd_ >= 0) {
-      rc = ::read(eventfd_, &value, sizeof(value));
+      rc = readNoInt(eventfd_, &value, sizeof(value));
     } else {
       uint8_t value8;
     } else {
       uint8_t value8;
-      rc = ::read(pipeFds_[0], &value8, sizeof(value8));
+      rc = readNoInt(pipeFds_[0], &value8, sizeof(value8));
       value = value8;
     }
     if (rc < 0) {
       value = value8;
     }
     if (rc < 0) {