From 7e91c8b5aa4548e15c01702f24aaf1f2fccf0468 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Fri, 7 Sep 2018 14:25:43 -0700 Subject: [PATCH] msg: set O_NONBLOCK on file status flags There is no NONBLOCK file **descriptor** flag. Signed-off-by: Patrick Donnelly --- src/msg/simple/Accepter.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/msg/simple/Accepter.cc b/src/msg/simple/Accepter.cc index dc5fe189dd261..b2712f8f6216a 100644 --- a/src/msg/simple/Accepter.cc +++ b/src/msg/simple/Accepter.cc @@ -60,9 +60,11 @@ int Accepter::create_selfpipe(int *pipe_rd, int *pipe_wr) { #else int ret = ::pipe(selfpipe); if (ret == 0) { - for (int i = 0; i < std::size(selfpipe); i++) { - int f = fcntl(selfpipe[i], F_GETFD); - fcntl(selfpipe[i], F_SETFD, f | FD_CLOEXEC | O_NONBLOCK); + 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); } } #endif