From 2c4377611228518a310bc4dd44e76f0517db3a85 Mon Sep 17 00:00:00 2001 From: chris_kohlhoff Date: Wed, 17 Oct 2007 02:16:20 +0000 Subject: [PATCH] Throw an exception if unable to create a pipe for the pipe_select_interrupter. --- asio/include/asio/detail/pipe_select_interrupter.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/asio/include/asio/detail/pipe_select_interrupter.hpp b/asio/include/asio/detail/pipe_select_interrupter.hpp index e203669c..c85765cc 100644 --- a/asio/include/asio/detail/pipe_select_interrupter.hpp +++ b/asio/include/asio/detail/pipe_select_interrupter.hpp @@ -19,6 +19,7 @@ #include "asio/detail/push_options.hpp" #include +#include #include "asio/detail/pop_options.hpp" #if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__) @@ -27,6 +28,8 @@ #include #include "asio/detail/pop_options.hpp" +#include "asio/error.hpp" +#include "asio/system_error.hpp" #include "asio/detail/socket_types.hpp" namespace asio { @@ -46,6 +49,12 @@ public: write_descriptor_ = pipe_fds[1]; ::fcntl(write_descriptor_, F_SETFL, O_NONBLOCK); } + else + { + asio::error_code ec(errno, asio::error::system_category); + asio::system_error e(ec, "pipe_select_interrupter"); + boost::throw_exception(e); + } } // Destructor.