MCPcopy Create free account
hub / github.com/Alexays/Waybar / getErrorMsg

Method getErrorMsg

src/modules/keyboard_state.cpp:28–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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
47auto openFile(const std::string& path, int flags) -> int {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected