]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg: set O_NONBLOCK on file status flags
authorPatrick Donnelly <pdonnell@redhat.com>
Fri, 7 Sep 2018 21:25:43 +0000 (14:25 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Thu, 27 Sep 2018 19:38:17 +0000 (12:38 -0700)
There is no NONBLOCK file **descriptor** flag.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 7e91c8b5aa4548e15c01702f24aaf1f2fccf0468)

Conflicts:
src/msg/simple/Accepter.cc

src/msg/simple/Accepter.cc

index 5779cc7abec69b8d52c66962e1092d56dbb6799e..d177793c5b0c2a5a7227d7b57120dd069b5781b3 100644 (file)
@@ -55,6 +55,14 @@ static int set_close_on_exec(int fd)
 int Accepter::create_selfpipe(int *pipe_rd, int *pipe_wr) {
   int selfpipe[2];
   int ret = ::pipe2(selfpipe, (O_CLOEXEC|O_NONBLOCK));
+  if (ret == 0) {
+    for (size_t i = 0; i < std::size(selfpipe); i++) {
+      int f = fcntl(selfpipe[i], F_GETFL);
+      ceph_assert(f != -1);
+      f = fcntl(selfpipe[i], F_SETFL, f | O_NONBLOCK);
+      ceph_assert(f != -1);
+    }
+  }
   if (ret < 0 ) {
     lderr(msgr->cct) << __func__ << " unable to create the selfpipe: "
                     << cpp_strerror(errno) << dendl;