Ticket #237 (new defect)
jabberd2 solaris support patch
| Reported by: | patthoyts | Owned by: | smoku |
|---|---|---|---|
| Priority: | major | Component: | Build |
| Version: | 2.2.1 | Keywords: | solaris segfault printf debug |
| Cc: | Tracforge_linkmap: | ||
| Blocking: | Blocked By: |
Description
The current svn trunk jabberd2 code cannot be run on solaris 10. The problem is the following construct:
const char *s = NULL; ... sprintf(buffer, "blah blah %s blah", s)
In the jabberd2 code this is mostly a problem in calls to one of the debug functions. In glibc and Microsoft's C libraries passing a NULL pointer to a %s template argument causes "(null)" to be placed in the string. With the Solaris libc for whatever tedious reason this will segfault. As a result, for solaris support anything that might cause a NULL pointer to be passed to a *printf function requires something like:
sprintf(buffer, template, s?s:"(null)");
Attached is a patch that has fixed enough of these to get jabberd2 running on my Solaris 10 ultrasparc. I use gcc and configured with --enable-sqlite --enable-debug --enable-ssl --enable-sasl=gsasl so I've not fixed anything in the other storage interfaces.
