[Asterisk-Dev] Asterisk support for Solaris 10 X86

Simon Lockhart simon at slimey.org
Tue Aug 2 00:50:55 MST 2005


On Fri Jul 22, 2005 at 09:37:13AM -0400, Jerris, Michael MI wrote:
> That is possibly from changes I made, but I do not have a solaris box to
> test on.  Can you please send me the output you get when it is
> compiling? 

The bit that stops it compiling on Solaris is the implementation of vasprintf()
in utils.c - as far as I can see, it's only used once, in cli.c

It didn't want to compile because the varargs stuff seemed to be completely
wrong for solaris. I've changed it as follows:

int vasprintf(char **strp, const char *fmt, ...)
{
        int size;
        char tmp[200];
        va_list ap, ap2;

        *strp = NULL;
        va_start(ap, fmt);
        va_copy(ap2, ap);
        size = vsnprintf(tmp, 20, fmt, ap2);
        va_end(ap2);
        *strp = malloc(size + 1);
        if (!*strp)
                return -1;
        vsnprintf(*strp, size + 1, fmt, ap);
        va_end(ap);

        return size;
}

But, whatever combination of tmp size and the '20' in the first vsnprintf,
it always coredumps when it runs at the moment. I'm not a varargs expert, so
I got a bit bogged down in trying to fix it.

I'd like to ensure that 1.2 compiles cleanly on Solaris, so it'd be good to 
fix this.

Simon



More information about the asterisk-dev mailing list