Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Commit

Permalink
avoid breaking API change to system_category in boost system
Browse files Browse the repository at this point in the history
  • Loading branch information
erikfrey committed Oct 2, 2012
1 parent 5c71b6b commit 100c6f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions include/darner/queue/queue.h
Expand Up @@ -208,19 +208,19 @@ class queue
void put(const key_type& key, const std::string& value) void put(const key_type& key, const std::string& value)
{ {
if (!journal_->Put(leveldb::WriteOptions(), key.slice(), value).ok()) if (!journal_->Put(leveldb::WriteOptions(), key.slice(), value).ok())
throw boost::system::system_error(boost::system::errc::io_error, boost::system::system_category()); throw boost::system::system_error(boost::system::errc::io_error, boost::asio::error::get_system_category());
} }


void get(const key_type& key, std::string& result) void get(const key_type& key, std::string& result)
{ {
if (!journal_->Get(leveldb::ReadOptions(), key.slice(), &result).ok()) if (!journal_->Get(leveldb::ReadOptions(), key.slice(), &result).ok())
throw boost::system::system_error(boost::system::errc::io_error, boost::system::system_category()); throw boost::system::system_error(boost::system::errc::io_error, boost::asio::error::get_system_category());
} }


void write(leveldb::WriteBatch& batch) void write(leveldb::WriteBatch& batch)
{ {
if (!journal_->Write(leveldb::WriteOptions(), &batch).ok()) if (!journal_->Write(leveldb::WriteOptions(), &batch).ok())
throw boost::system::system_error(boost::system::errc::io_error, boost::system::system_category()); throw boost::system::system_error(boost::system::errc::io_error, boost::asio::error::get_system_category());
} }


boost::scoped_ptr<comparator> cmp_; boost::scoped_ptr<comparator> cmp_;
Expand Down
3 changes: 2 additions & 1 deletion src/queue/queue.cpp
Expand Up @@ -128,7 +128,8 @@ void queue::pop_read(std::string& result_item, header_type& result_header, id_ty
else if (result_item[result_item.size() - 2] == '\0') // \0 \0 means escaped \0 else if (result_item[result_item.size() - 2] == '\0') // \0 \0 means escaped \0
result_item.resize(result_item.size() - 1); result_item.resize(result_item.size() - 1);
else else
throw system::system_error(system::errc::io_error, system::system_category()); // anything else is bad data throw system::system_error(system::errc::io_error,
boost::asio::error::get_system_category()); // anything else is bad data
} }


++items_open_; ++items_open_;
Expand Down

0 comments on commit 100c6f9

Please sign in to comment.