aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2007-10-10 09:54:59 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2007-10-10 09:54:59 +0000
commit334182900e1a21e7c3dbaad3ebb7b27f87d6a1b9 (patch)
tree04990edb017c7c400f579f9346e06af3fa8495ad
parenta7ebcdbeae9d62fe0c867082dceaf092dc621e22 (diff)
downloadpaludis-334182900e1a21e7c3dbaad3ebb7b27f87d6a1b9.tar.gz
paludis-334182900e1a21e7c3dbaad3ebb7b27f87d6a1b9.tar.xz
Fix exception handling.
-rw-r--r--src/clients/reconcilio/littlelf/elf.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/clients/reconcilio/littlelf/elf.cc b/src/clients/reconcilio/littlelf/elf.cc
index 296a5f0..d71f672 100644
--- a/src/clients/reconcilio/littlelf/elf.cc
+++ b/src/clients/reconcilio/littlelf/elf.cc
@@ -117,10 +117,10 @@ template <typename ElfType_>
bool
ElfObject<ElfType_>::is_valid_elf(std::istream & stream)
{
- StreamExceptions exns(stream, std::ios::eofbit | std::ios::failbit | std::ios::badbit);
-
try
{
+ StreamExceptions exns(stream, std::ios::eofbit | std::ios::failbit | std::ios::badbit);
+
stream.seekg(0, std::ios::beg);
if (stream.fail())
return false;
@@ -156,10 +156,10 @@ template <typename ElfType_>
ElfObject<ElfType_>::ElfObject(std::istream & stream) :
PrivateImplementationPattern<ElfObject>(new Implementation<ElfObject>)
{
- StreamExceptions exns(stream, std::ios::eofbit | std::ios::failbit | std::ios::badbit);
-
try
{
+ StreamExceptions exns(stream, std::ios::eofbit | std::ios::failbit | std::ios::badbit);
+
stream.seekg(0, std::ios::beg);
stream.read(reinterpret_cast<char *>(&_hdr), sizeof(typename ElfType_::Header));
stream.seekg(_hdr.e_shoff, std::ios::beg);