"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/log.c" between
dnsmasq-2.84.tar.xz and dnsmasq-2.85.tar.xz

About: Dnsmasq is a lightweight caching DNS forwarder and DHCP server.

log.c  (dnsmasq-2.84.tar.xz):log.c  (dnsmasq-2.85.tar.xz)
skipping to change at line 275 skipping to change at line 275
when logging to a file, for instance. */ when logging to a file, for instance. */
log_fd = -1; log_fd = -1;
my_syslog(LOG_CRIT, _("log failed: %s"), strerror(errno)); my_syslog(LOG_CRIT, _("log failed: %s"), strerror(errno));
return; return;
} }
} }
/* priority is one of LOG_DEBUG, LOG_INFO, LOG_NOTICE, etc. See sys/syslog.h. /* priority is one of LOG_DEBUG, LOG_INFO, LOG_NOTICE, etc. See sys/syslog.h.
OR'd to priority can be MS_TFTP, MS_DHCP, ... to be able to do log separation between OR'd to priority can be MS_TFTP, MS_DHCP, ... to be able to do log separation between
DNS, DHCP and TFTP services. DNS, DHCP and TFTP services.
*/ If OR'd with MS_DEBUG, the messages are suppressed unless --log-debug is set. */
void my_syslog(int priority, const char *format, ...) void my_syslog(int priority, const char *format, ...)
{ {
va_list ap; va_list ap;
struct log_entry *entry; struct log_entry *entry;
time_t time_now; time_t time_now;
char *p; char *p;
size_t len; size_t len;
pid_t pid = getpid(); pid_t pid = getpid();
char *func = ""; char *func = "";
if ((LOG_FACMASK & priority) == MS_TFTP) if ((LOG_FACMASK & priority) == MS_TFTP)
func = "-tftp"; func = "-tftp";
else if ((LOG_FACMASK & priority) == MS_DHCP) else if ((LOG_FACMASK & priority) == MS_DHCP)
func = "-dhcp"; func = "-dhcp";
else if ((LOG_FACMASK & priority) == MS_SCRIPT) else if ((LOG_FACMASK & priority) == MS_SCRIPT)
func = "-script"; func = "-script";
else if ((LOG_FACMASK & priority) == MS_DEBUG)
{
if (!option_bool(OPT_LOG_DEBUG))
return;
func = "-debug";
}
#ifdef LOG_PRI #ifdef LOG_PRI
priority = LOG_PRI(priority); priority = LOG_PRI(priority);
#else #else
/* Solaris doesn't have LOG_PRI */ /* Solaris doesn't have LOG_PRI */
priority &= LOG_PRIMASK; priority &= LOG_PRIMASK;
#endif #endif
if (echo_stderr) if (echo_stderr)
{ {
 End of changes. 2 change blocks. 
1 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)