Browse Source

Fix possible error handling issue with errno

pull/1624/head
Antonio SJ Musumeci 2 weeks ago
parent
commit
9e3e4b690d
  1. 2
      src/config.cpp

2
src/config.cpp

@ -471,9 +471,11 @@ Config::from_file(const std::string &filepath_)
int rv; int rv;
std::ifstream ifstrm; std::ifstream ifstrm;
errno = 0;
ifstrm.open(filepath_); ifstrm.open(filepath_);
if(!ifstrm.good()) if(!ifstrm.good())
{ {
errno = errno ? errno : EIO;
errs.push_back({errno,filepath_}); errs.push_back({errno,filepath_});
return -errno; return -errno;
} }

Loading…
Cancel
Save