libcryfs/src/fspp/impl/FuseErrnoException.h

29 lines
506 B
C
Raw Normal View History

#pragma once
2014-11-16 00:05:28 +01:00
#ifndef FSPP_FUSE_FUSEERRNOEXCEPTION_H_
#define FSPP_FUSE_FUSEERRNOEXCEPTION_H_
#include <stdexcept>
#include <errno.h>
2014-11-16 00:05:28 +01:00
namespace fspp {
class FuseErrnoException: public std::runtime_error {
public:
FuseErrnoException(int errno_);
virtual ~FuseErrnoException();
int getErrno() const;
private:
int _errno;
};
inline void CHECK_RETVAL(int retval) {
if (retval < 0) {
throw FuseErrnoException(errno);
}
}
2014-11-16 00:05:28 +01:00
} /* namespace fspp */
2014-11-16 00:05:28 +01:00
#endif /* FSPP_FUSE_FUSEERRNOEXCEPTION_H_ */