static void
debug(int level, char *fmt, ...)
{
        va_list arg;
        char buf[512];

        if (!(debuglevel & level))
                return;
        va_start(arg, fmt);
        vsnprintf(buf, sizeof(buf), fmt, arg);
        va_end(arg);

        if (!netaddress)
                fprintf(stderr, "Master: %s", buf);
        else
                fprintf(stderr, "%s", buf);

        if (logfid)
                spc_write(logfid, (u8 *) buf, strlen(buf), 0);
}


note that if we're not logging a file we fprintf to stderr. But fd has
been reused in at least one case.

ron

Reply via email to