Navigation Menu

Skip to content

Commit

Permalink
msg: set O_NONBLOCK on file status flags
Browse files Browse the repository at this point in the history
There is no NONBLOCK file **descriptor** flag.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
  • Loading branch information
batrick committed Sep 20, 2018
1 parent e606e21 commit 7e91c8b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/msg/simple/Accepter.cc
Expand Up @@ -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
Expand Down

0 comments on commit 7e91c8b

Please sign in to comment.