| 26 | |
| 27 | private: |
| 28 | static auto getErrorMsg(int err, const char* msg) -> std::string { |
| 29 | std::string error_msg{msg}; |
| 30 | error_msg += ": "; |
| 31 | |
| 32 | #if (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 32) |
| 33 | // strerrorname_np gets the error code's name; it's nice to have, but it's a recent GNU |
| 34 | // extension |
| 35 | const auto errno_name = strerrorname_np(err); |
| 36 | error_msg += errno_name; |
| 37 | error_msg += " "; |
| 38 | #endif |
| 39 | |
| 40 | const auto errno_str = strerror(err); |
| 41 | error_msg += errno_str; |
| 42 | |
| 43 | return error_msg; |
| 44 | } |
| 45 | }; |
| 46 | |
| 47 | auto openFile(const std::string& path, int flags) -> int { |
nothing calls this directly
no outgoing calls
no test coverage detected