提交 0b763a62 authored 作者: Steve Underwood's avatar Steve Underwood

Merge branch 'master' of git.freeswitch.org:freeswitch

...@@ -495,6 +495,13 @@ AC_CHECK_FUNCS([gethostname vasprintf mmap mlock mlockall usleep getifaddrs time ...@@ -495,6 +495,13 @@ AC_CHECK_FUNCS([gethostname vasprintf mmap mlock mlockall usleep getifaddrs time
AC_CHECK_FUNCS([sched_setscheduler setpriority setrlimit setgroups initgroups]) AC_CHECK_FUNCS([sched_setscheduler setpriority setrlimit setgroups initgroups])
AC_CHECK_FUNCS([wcsncmp setgroups asprintf setenv pselect gettimeofday localtime_r gmtime_r strcasecmp stricmp _stricmp]) AC_CHECK_FUNCS([wcsncmp setgroups asprintf setenv pselect gettimeofday localtime_r gmtime_r strcasecmp stricmp _stricmp])
# Check availability and return type of strerror_r
# (NOTE: apr-1-config sets -D_GNU_SOURCE at build-time, need to run the check with it too)
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
AC_FUNC_STRERROR_R
CPPFLAGS="$save_CPPFLAGS"
AX_HAVE_CPU_SET AX_HAVE_CPU_SET
AC_CHECK_LIB(rt, clock_gettime, [AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if you have clock_gettime()])]) AC_CHECK_LIB(rt, clock_gettime, [AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if you have clock_gettime()])])
......
...@@ -880,6 +880,7 @@ missing ...@@ -880,6 +880,7 @@ missing
/yaml/tests/run-parser /yaml/tests/run-parser
/yaml/tests/run-scanner /yaml/tests/run-scanner
/zeromq-*/ /zeromq-*/
/jpeg-8d/
# build products we should remove # build products we should remove
!/apr-util/xml/expat/conftools/config.guess !/apr-util/xml/expat/conftools/config.guess
......
...@@ -376,7 +376,7 @@ Sub CreateVersion(tmpFolder, VersionDir, includebase, includedest) ...@@ -376,7 +376,7 @@ Sub CreateVersion(tmpFolder, VersionDir, includebase, includedest)
If strLastCommit <> "" And strLastCommitHuman <> "" And strRevision <> "" Then If strLastCommit <> "" And strLastCommitHuman <> "" And strRevision <> "" Then
'Bild version string 'Bild version string
strGitVer = "git~" & strLastCommit & "~" & strRevision strGitVer = "git~" & strLastCommit & "~" & strRevision
strVerHuman = "; git at commit " & strRevision & " on " & strLastCommitHuman strVerHuman = strVerRev & "; git at commit " & strRevision & " on " & strLastCommitHuman
'Check for local changes, if found, append to git revision string 'Check for local changes, if found, append to git revision string
If ShowUnclean Then If ShowUnclean Then
......
...@@ -837,6 +837,16 @@ SWITCH_DECLARE(char *) switch_format_number(const char *num); ...@@ -837,6 +837,16 @@ SWITCH_DECLARE(char *) switch_format_number(const char *num);
SWITCH_DECLARE(unsigned int) switch_atoui(const char *nptr); SWITCH_DECLARE(unsigned int) switch_atoui(const char *nptr);
SWITCH_DECLARE(unsigned long) switch_atoul(const char *nptr); SWITCH_DECLARE(unsigned long) switch_atoul(const char *nptr);
/**
* Portable version of strerror_r(), work around for the incompatible
* return type of GNU and XSI variants.
* \param[in] errnum Error number
* \param[both] buf Buffer for error message
* \param[in] buflen Size of message buffer
* \return Pointer to message buffer, returning error message or "Unknown error xxx" if none found
*/
SWITCH_DECLARE(char *) switch_strerror_r(int errnum, char *buf, switch_size_t buflen);
SWITCH_END_EXTERN_C SWITCH_END_EXTERN_C
#endif #endif
/* For Emacs: /* For Emacs:
......
...@@ -1029,12 +1029,8 @@ static void conference_cdr_render(conference_obj_t *conference) ...@@ -1029,12 +1029,8 @@ static void conference_cdr_render(conference_obj_t *conference)
fd = -1; fd = -1;
} else { } else {
char ebuf[512] = { 0 }; char ebuf[512] = { 0 };
#ifdef WIN32 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error writing [%s][%s]\n",
strerror_s(ebuf, sizeof(ebuf), errno); path, switch_strerror_r(errno, ebuf, sizeof(ebuf)));
#else
strerror_r(errno, ebuf, sizeof(ebuf));
#endif
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error writing [%s][%s]\n", path, ebuf);
} }
......
...@@ -253,12 +253,8 @@ static switch_status_t my_on_reporting(switch_core_session_t *session) ...@@ -253,12 +253,8 @@ static switch_status_t my_on_reporting(switch_core_session_t *session)
} }
} else { } else {
char ebuf[512] = { 0 }; char ebuf[512] = { 0 };
#ifdef WIN32 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error writing [%s][%s]\n",
strerror_s(ebuf, sizeof(ebuf), errno); path, switch_strerror_r(errno, ebuf, sizeof(ebuf)));
#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_safe_free(path); switch_safe_free(path);
} }
...@@ -412,12 +408,8 @@ static switch_status_t my_on_reporting(switch_core_session_t *session) ...@@ -412,12 +408,8 @@ static switch_status_t my_on_reporting(switch_core_session_t *session)
break; break;
} else { } else {
char ebuf[512] = { 0 }; char ebuf[512] = { 0 };
#ifdef WIN32 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't open %s! [%s]\n",
strerror_s(ebuf, sizeof(ebuf), errno); path, switch_strerror_r(errno, ebuf, sizeof(ebuf)));
#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);
} }
......
...@@ -244,12 +244,8 @@ static switch_status_t my_on_reporting(switch_core_session_t *session) ...@@ -244,12 +244,8 @@ static switch_status_t my_on_reporting(switch_core_session_t *session)
fd = -1; fd = -1;
} else { } else {
char ebuf[512] = { 0 }; char ebuf[512] = { 0 };
#ifdef WIN32 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error writing [%s][%s]\n",
strerror_s(ebuf, sizeof(ebuf), errno); path, switch_strerror_r(errno, ebuf, sizeof(ebuf)));
#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_safe_free(path); switch_safe_free(path);
} }
...@@ -400,12 +396,8 @@ static switch_status_t my_on_reporting(switch_core_session_t *session) ...@@ -400,12 +396,8 @@ static switch_status_t my_on_reporting(switch_core_session_t *session)
fd = -1; fd = -1;
} else { } else {
char ebuf[512] = { 0 }; char ebuf[512] = { 0 };
#ifdef WIN32 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error![%s]\n",
strerror_s(ebuf, sizeof(ebuf), errno); switch_strerror_r(errno, ebuf, sizeof(ebuf)));
#else
strerror_r(errno, ebuf, sizeof(ebuf));
#endif
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error![%s]\n", ebuf);
} }
} }
} }
......
...@@ -3310,8 +3310,8 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ ...@@ -3310,8 +3310,8 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
if (!SWITCH_STATUS_IS_BREAK(poll_status) && poll_status != SWITCH_STATUS_TIMEOUT) { if (!SWITCH_STATUS_IS_BREAK(poll_status) && poll_status != SWITCH_STATUS_TIMEOUT) {
char tmp[128] = ""; char tmp[128] = "";
strerror_r(poll_status, tmp, sizeof(tmp)); switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Poll failed with error: %d [%s]\n",
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Poll failed with error: %d [%s]\n", poll_status, tmp); poll_status, switch_strerror_r(poll_status, tmp, sizeof(tmp)));
ret = -1; ret = -1;
goto end; goto end;
} }
......
...@@ -2968,6 +2968,37 @@ SWITCH_DECLARE(unsigned long) switch_atoul(const char *nptr) ...@@ -2968,6 +2968,37 @@ SWITCH_DECLARE(unsigned long) switch_atoul(const char *nptr)
else return (unsigned long) tmp; else return (unsigned long) tmp;
} }
SWITCH_DECLARE(char *) switch_strerror_r(int errnum, char *buf, switch_size_t buflen)
{
#ifdef HAVE_STRERROR_R
#ifdef STRERROR_R_CHAR_P
/* GNU variant returning char *, avoids warn-unused-result error */
return strerror_r(errnum, buf, buflen);
#else
/*
* XSI variant returning int, with GNU compatible error string,
* if no message could be found
*/
if (strerror_r(errnum, buf, buflen)) {
switch_snprintf(buf, buflen, "Unknown error %d", errnum);
}
return buf;
#endif /* STRERROR_R_CHAR_P */
#elif defined(WIN32)
/* WIN32 variant */
if (strerror_s(buf, buflen, errnum)) {
switch_snprintf(buf, buflen, "Unknown error %d", errnum);
}
return buf;
#else
/* Fallback, copy string into private buffer */
switch_copy_string(buf, strerror(errnum), buflen);
return buf;
#endif
}
/* For Emacs: /* For Emacs:
* Local Variables: * Local Variables:
* mode:c * mode:c
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论