From d0f5817f4720b49ffaee9fa9593b2f11446963a0 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Thu, 18 Feb 2016 21:39:06 -0500 Subject: Add nullary constructor to IoError The constructor constructs an IoError based on the current errno. --- src/posix_extras.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/posix_extras.cc') diff --git a/src/posix_extras.cc b/src/posix_extras.cc index d06dc41..c3c841c 100644 --- a/src/posix_extras.cc +++ b/src/posix_extras.cc @@ -50,7 +50,7 @@ std::string IoError::Message(const int number) noexcept { File::File(const char* const path, const int flags) : path_(path) { if ((fd_ = open(path, flags)) == -1) { - throw IoError(errno); + throw IoError(); } } @@ -65,7 +65,7 @@ File::~File() noexcept { struct stat File::Stat() const { struct stat result; if (fstat(fd_, &result) == -1) { - throw IoError(errno); + throw IoError(); } return result; } @@ -77,7 +77,7 @@ struct stat File::LinkStatAt(const char* const path) const { struct stat result; if (fstatat(fd_, path, &result, AT_SYMLINK_NOFOLLOW) == -1) { - throw IoError(errno); + throw IoError(); } return result; } -- cgit v1.2.3