예제 #1
0
파일: message.c 프로젝트: wucan/xmux
void msg_trace (msgobj *mo, const char *fmt, ...)
{
	va_list ap;

	va_start(ap, fmt);
	msg_output(mo, MSG_TRACE, fmt, ap);
	va_end(ap);
}
예제 #2
0
파일: message.c 프로젝트: wucan/xmux
void msg_dbg (msgobj *mo, const char *fmt, ...)
{
	va_list ap;

	va_start(ap, fmt);
	msg_output(mo, MSG_DBG, fmt, ap);
	va_end(ap);
}
예제 #3
0
파일: message.c 프로젝트: wucan/xmux
void msg_info (msgobj *mo, const char *fmt, ...)
{
	va_list ap;

	va_start(ap, fmt);
	msg_output(mo, MSG_INFO, fmt, ap);
	va_end(ap);
}
예제 #4
0
파일: message.c 프로젝트: wucan/xmux
void msg_warn (msgobj *mo, const char *fmt, ...)
{
	va_list ap;

	va_start(ap, fmt);
	msg_output(mo, MSG_WARN, fmt, ap);
	va_end(ap);
}
예제 #5
0
void    msg_vstream_init(const char *name, VSTREAM *vp)
{
    static int first_call = 1;

    msg_tag = name;
    msg_stream = vp;
    if (first_call) {
	first_call = 0;
	msg_output(msg_vstream_print);
    }
}
예제 #6
0
void    msg_syslog_init(const char *name, int logopt, int facility)
{
    static int first_call = 1;

    /*
     * XXX If this program is set-gid, then TZ must not be trusted. This
     * scrubbing code is in the wrong place.
     */
    if (unsafe())
	putenv("TZ=UTC");
    tzset();
    openlog(name, LOG_NDELAY | logopt, facility);
    if (first_call) {
	first_call = 0;
	msg_output(msg_syslog_print);
    }
}
예제 #7
0
파일: msg_syslog.c 프로젝트: ii0/postfix
void    msg_syslog_init(const char *name, int logopt, int facility)
{
    static int first_call = 1;
    extern char **environ;

    /*
     * XXX If this program is set-gid, then TZ must not be trusted. This
     * scrubbing code is in the wrong place.
     */
    if (unsafe())
	while (getenv("TZ"))			/* There may be multiple. */
	    if (unsetenv("TZ") < 0) {		/* Desperate measures. */
		environ[0] = 0;
		msg_fatal("unsetenv: %m");
	    }
    tzset();
    openlog(name, LOG_NDELAY | logopt, facility);
    if (first_call) {
	first_call = 0;
	msg_output(msg_syslog_print);
    }
}