mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-11 20:17:05 +00:00
FreeSWITCH: Add WIN32 strerror_s() variant to custom switch_strerror_r() helper function and fix more strerror_r() users.
Convert mod_xml_cdr, mod_json_cdr and mod_conference to the new function. Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
This commit is contained in:
1 parent
8bcf3b4fb8
commit
eca5c0ad73
4 files changed
+16
-30
No files matched your search
@@ -253,12 +253,8 @@ static switch_status_t my_on_reporting(switch_core_session_t *session)
|
||||
}
|
||||
} else {
|
||||
char ebuf[512] = { 0 };
|
||||
#ifdef WIN32
|
||||
strerror_s(ebuf, sizeof(ebuf), errno);
|
||||
#else
|
||||
strerror_r(errno, ebuf, sizeof(ebuf));
|
||||
#endif
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error writing [%s][%s]\n", path, ebuf);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error writing [%s][%s]\n",
|
||||
path, switch_strerror_r(errno, ebuf, sizeof(ebuf)));
|
||||
}
|
||||
switch_safe_free(path);
|
||||
}
|
||||
@@ -412,12 +408,8 @@ static switch_status_t my_on_reporting(switch_core_session_t *session)
|
||||
break;
|
||||
} else {
|
||||
char ebuf[512] = { 0 };
|
||||
#ifdef WIN32
|
||||
strerror_s(ebuf, sizeof(ebuf), errno);
|
||||
#else
|
||||
strerror_r(errno, ebuf, sizeof(ebuf));
|
||||
#endif
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't open %s! [%s]\n", path, ebuf);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't open %s! [%s]\n",
|
||||
path, switch_strerror_r(errno, ebuf, sizeof(ebuf)));
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user