Skip to content
Snippets Groups Projects
Commit ad6c078c authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Thread-safe wrappers for std/socket errno description getters for sbbs_t

These should only be used in the sbbs_t methods called by node_thread or
event_thread. Any other thread-shared sbbs_t instances should not use these
methods since they share a single error description string buffer.
parent 30f7d76f
No related branches found
No related tags found
No related merge requests found
...@@ -942,6 +942,11 @@ public: ...@@ -942,6 +942,11 @@ public:
void scroll_hotspots(int count); void scroll_hotspots(int count);
void set_mouse(int mode); void set_mouse(int mode);
// Thread-safe std/socket errno description getters
char strerror_buf[256]{};
const char* strerror(int errnum) { return safe_strerror(errnum, strerror_buf, sizeof strerror_buf); }
const char* socket_strerror(int errnum) { return ::socket_strerror(errnum, strerror_buf, sizeof strerror_buf); }
/* prntfile.cpp */ /* prntfile.cpp */
bool printfile(const char* fname, int mode, int org_cols = 0, JSObject* obj = NULL); bool printfile(const char* fname, int mode, int org_cols = 0, JSObject* obj = NULL);
bool printtail(const char* fname, int lines, int mode, int org_cols = 0, JSObject* obj = NULL); bool printtail(const char* fname, int lines, int mode, int org_cols = 0, JSObject* obj = NULL);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment