diff options
Diffstat (limited to 'cpp/src/qpid/sys/posix/check.h')
| -rw-r--r-- | cpp/src/qpid/sys/posix/check.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cpp/src/qpid/sys/posix/check.h b/cpp/src/qpid/sys/posix/check.h index fe53321e27..7fa7b69d3b 100644 --- a/cpp/src/qpid/sys/posix/check.h +++ b/cpp/src/qpid/sys/posix/check.h @@ -43,7 +43,7 @@ class PosixError : public qpid::QpidError int getErrNo() { return errNo; } - Exception* clone() const throw() { return new PosixError(*this); } + Exception::auto_ptr clone() const throw() { return Exception::auto_ptr(new PosixError(*this)); } void throwSelf() const { throw *this; } @@ -56,6 +56,10 @@ class PosixError : public qpid::QpidError /** Create a PosixError for the current file/line and errno. */ #define QPID_POSIX_ERROR(errNo) ::qpid::sys::PosixError(errNo, SRCLINE) +/** Throw QPID_POSIX_ERROR(errno) if RESULT is less than zero */ +#define QPID_POSIX_CHECK(RESULT) \ + if ((RESULT) < 0) throw QPID_POSIX_ERROR((errno)) + /** Throw a posix error if errNo is non-zero */ #define QPID_POSIX_THROW_IF(ERRNO) \ if ((ERRNO) != 0) throw QPID_POSIX_ERROR((ERRNO)) |
