Permalink
Browse files

maintenance

  • Loading branch information...
Neverlord committed Aug 21, 2012
1 parent 96b71cf commit 1e98cb461ab4520a27ab9d8c32ac1220c40e2989
Showing with 2 additions and 12 deletions.
  1. +0 −1 src/ipv4_acceptor.cpp
  2. +0 −1 src/ipv4_io_stream.cpp
  3. +2 −9 src/network_manager.cpp
  4. +0 −1 src/unicast_network.cpp
View
@@ -46,7 +46,6 @@
# include <sys/socket.h>
# include <netinet/in.h>
# include <netinet/tcp.h>
-# include <fcntl.h>
#endif
namespace cppa { namespace detail {
View
@@ -45,7 +45,6 @@
# include <sys/socket.h>
# include <netinet/in.h>
# include <netinet/tcp.h>
-# include <fcntl.h>
#endif
namespace cppa { namespace detail {
View
@@ -30,7 +30,6 @@
#include <cstdio>
#include <thread>
-#include <fcntl.h>
#include <cstdint>
#include <cstring> // strerror
#include <unistd.h>
@@ -44,6 +43,7 @@
#include "cppa/intrusive/single_reader_queue.hpp"
+#include "cppa/detail/fd_util.hpp"
#include "cppa/detail/middleman.hpp"
#include "cppa/detail/network_manager.hpp"
@@ -65,14 +65,7 @@ struct network_manager_impl : network_manager {
}
// store pipe read handle in local variables for lambda expression
int pipe_fd0 = pipe_fd[0];
- // set read handle to nonblocking
- auto flags = fcntl(pipe_fd0, F_GETFL, 0);
- if (flags == -1) {
- throw network_error("unable to read socket flags");
- }
- if (fcntl(pipe_fd0, F_SETFL, flags | O_NONBLOCK) < 0) {
- CPPA_CRITICAL("unable to set pipe read handle to nonblock");
- }
+ fd_util::nonblocking(pipe_fd0, true);
// start threads
m_middleman_thread = std::thread([this, pipe_fd0] {
middleman_loop(pipe_fd0, this->m_middleman_queue);
View
@@ -37,7 +37,6 @@
#include <iostream>
#include <stdexcept>
-#include <fcntl.h>
#include <netinet/tcp.h>
#include "cppa/cppa.hpp"

0 comments on commit 1e98cb4

Please sign in to comment.