diff options
author | randomdan <randomdan@localhost> | 2012-02-12 14:39:28 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2012-02-12 14:39:28 +0000 |
commit | 722901e3922cda2e53707c84700a309a99ff9d55 (patch) | |
tree | debeb5af1f05909003f8a8ace816f4578e5af587 /project2/common/exceptions.cpp | |
parent | Add some more aggregates (diff) | |
download | project2-722901e3922cda2e53707c84700a309a99ff9d55.tar.bz2 project2-722901e3922cda2e53707c84700a309a99ff9d55.tar.xz project2-722901e3922cda2e53707c84700a309a99ff9d55.zip |
Adds support for presenter level caching modules and implements a file based one (requires xattr support)
Diffstat (limited to 'project2/common/exceptions.cpp')
-rw-r--r-- | project2/common/exceptions.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/project2/common/exceptions.cpp b/project2/common/exceptions.cpp index 2fa5509..4f061ab 100644 --- a/project2/common/exceptions.cpp +++ b/project2/common/exceptions.cpp @@ -48,3 +48,26 @@ two_part_error::what() const throw() return buf; } + +syscall_error::syscall_error(int e) : + err(e), + buf(NULL) +{ +} + +syscall_error::~syscall_error() throw() +{ + free(buf); +} + +const char * +syscall_error::what() const throw() +{ + if (!buf) { + if (asprintf(&buf, "%s (%d)", strerror(err), err) < 1) { + throw std::bad_alloc(); + } + } + return buf; +} + |