From 56aaf4e71f01cecab2e50b721029f63a9db3200b Mon Sep 17 00:00:00 2001 From: AlanAtWork Date: Thu, 25 Oct 2018 10:40:22 -0500 Subject: [PATCH] Throw std::system_error --- include/mio/mmap.hpp | 4 ++-- include/mio/shared_mmap.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/mio/mmap.hpp b/include/mio/mmap.hpp index 8e5d7c0..513eae8 100644 --- a/include/mio/mmap.hpp +++ b/include/mio/mmap.hpp @@ -112,7 +112,7 @@ public: { std::error_code error; map(path, offset, length, error); - if(error) { throw error; } + if(error) { throw std::system_error(error); } } /** @@ -123,7 +123,7 @@ public: { std::error_code error; map(handle, offset, length, error); - if(error) { throw error; } + if(error) { throw std::system_error(error); } } /** diff --git a/include/mio/shared_mmap.hpp b/include/mio/shared_mmap.hpp index 0ca5c14..b8f8799 100644 --- a/include/mio/shared_mmap.hpp +++ b/include/mio/shared_mmap.hpp @@ -96,7 +96,7 @@ public: { std::error_code error; map(path, offset, length, error); - if(error) { throw error; } + if(error) { throw std::system_error(error); } } /** @@ -107,7 +107,7 @@ public: { std::error_code error; map(handle, offset, length, error); - if(error) { throw error; } + if(error) { throw std::system_error(error); } } /**