libzrtp strings are weird, and we were previously misusing the
function zrtp_zstrcpyc. We can't use ZSTR_GV because it does insane
things and causes an array-bounds warning on gcc 4.7. So we have to
take matters into our own hands and setup the string correctly and
copy data into it.
Because we were doing it wrong, people would get weird pseudo-random
single-character names for the zrtp cache file, and the file would end
up in the wrong place. Now that this is fixed, users will need to
locate and move their zrtp cache file to their db_dir and name it
"zrtp.dat" if they wish to keep their current ZRTP cache.
FS-4344 --resolve
GNU variant of strerror_r() returns char *, while the XSI version returns int.
To make things worse, glibc ships both and added a unused result warning
in recent versions (2.16) causing the build to fail.
Add our own custom wrapper that always returns a pointer to the message buffer
and additionally make XSI versions of strerror_r() GNU compatible by
returning "Unknown error xxx" if no error message is available.
Fixes:
src/switch_rtp.c: In function 'rtp_common_read':
src/switch_rtp.c:3313:15: error: ignoring return value of 'strerror_r',
declared with attribute warn_unused_result [-Werror=unused-result]
cc1: all warnings being treated as errors
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
*sigh* of course there are two versions of strerror_r():
char *strerror_r() - GNU
int strerror_r() - non-GNU
Revert and back the drawing board...
This reverts commit 3c82033e532081fb42678a2ba297f9bd32b94635.