diff --git a/src/util/file_util.cpp b/src/util/file_util.cpp index bf29af82ca6..d1cd3378a05 100644 --- a/src/util/file_util.cpp +++ b/src/util/file_util.cpp @@ -54,7 +54,7 @@ std::string get_current_working_directory() errno=0; char *wd=realpath(".", nullptr); - if(wd == nullptr || errno != 0) + if(wd == nullptr) throw system_exceptiont( std::string("realpath failed: ") + std::strerror(errno)); diff --git a/src/util/tempdir.cpp b/src/util/tempdir.cpp index d61636b7dc4..7fd9f3230e9 100644 --- a/src/util/tempdir.cpp +++ b/src/util/tempdir.cpp @@ -93,7 +93,7 @@ std::string get_temporary_directory(const std::string &name_template) errno = 0; char *wd = realpath(td, nullptr); - if(wd == nullptr || errno != 0) + if(wd == nullptr) throw system_exceptiont( std::string("realpath failed: ") + std::strerror(errno));