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); }
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); }
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); }
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); }
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); } }
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); } }
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); } }