diff options
-rw-r--r-- | project2/common/appInstance.cpp | 4 | ||||
-rw-r--r-- | project2/compression/gzip.cpp | 4 | ||||
-rw-r--r-- | project2/daemon/tempPrivs.cpp | 8 |
3 files changed, 4 insertions, 12 deletions
diff --git a/project2/common/appInstance.cpp b/project2/common/appInstance.cpp index 72d34a9..3f8ab58 100644 --- a/project2/common/appInstance.cpp +++ b/project2/common/appInstance.cpp @@ -13,9 +13,7 @@ AppInstance::AppInstance() AppInstance::~AppInstance() { - if (_current != this) { - throw std::runtime_error("All kinds of bad, destroying a non-current AppInstance"); - } + BOOST_ASSERT_MSG(_current == this, "All kinds of bad, destroying a non-current AppInstance"); _current = NULL; } diff --git a/project2/compression/gzip.cpp b/project2/compression/gzip.cpp index 653143f..cbccf40 100644 --- a/project2/compression/gzip.cpp +++ b/project2/compression/gzip.cpp @@ -19,9 +19,7 @@ class GZip : public Decompressor { ~GZip() { inflateEnd(&strm); - if (status != Z_STREAM_END) { - throw std::runtime_error("decompression of stream failed"); - } + BOOST_ASSERT_MSG(status == Z_STREAM_END, "decompression of stream failed"); } void decompress(const char * data, size_t len, const Stream::Sink & sink) { diff --git a/project2/daemon/tempPrivs.cpp b/project2/daemon/tempPrivs.cpp index 9c5edbd..45af498 100644 --- a/project2/daemon/tempPrivs.cpp +++ b/project2/daemon/tempPrivs.cpp @@ -20,14 +20,10 @@ TempPrivs::TempPrivs() : TempPrivs::~TempPrivs() { if (DaemonAppEngine::setUser) { - if (seteuid(originalUid)) { - throw std::runtime_error("Failed restore uid"); - } + BOOST_ASSERT_MSG(!seteuid(originalUid), "Failed restore uid"); } if (DaemonAppEngine::setGroup) { - if (setegid(originalGid)) { - throw std::runtime_error("Failed restore gid"); - } + BOOST_ASSERT_MSG(!setegid(originalGid), "Failed restore gid"); } } |