We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 35aecff commit 8300275Copy full SHA for 8300275
1 file changed
include/osmium/index/detail/create_map_with_fd.hpp
@@ -35,10 +35,10 @@ DEALINGS IN THE SOFTWARE.
35
36
#include <cassert>
37
#include <cerrno>
38
-#include <cstring>
39
#include <fcntl.h>
40
#include <stdexcept>
41
#include <string>
+#include <system_error>
42
#include <vector>
43
44
namespace osmium {
@@ -56,7 +56,7 @@ namespace osmium {
56
const std::string& filename = config[1];
57
const int fd = ::open(filename.c_str(), O_CREAT | O_RDWR, 0644); // NOLINT(hicpp-signed-bitwise)
58
if (fd == -1) {
59
- throw std::runtime_error{std::string{"can't open file '"} + filename + "': " + std::strerror(errno)};
+ throw std::system_error{errno, std::system_category(), "can't open file '" + filename + "'"};
60
}
61
return new T{fd};
62
0 commit comments