1 #include <stdio.h> 2 #include <syslog.h> 3 #include <stdarg.h> 4 5 #include "include/log.h" 6 7 extern int daemonize; 8 9 void log_start(void) 10 { 11 openlog("mountd", LOG_PID, LOG_DAEMON); 12 } 13 14 void log_stop(void) 15 { 16 closelog(); 17 } 18 19 void log_printf(char *fmt, ...) 20 { 21 char p[256]; 22 va_list ap; 23 24 va_start(ap, fmt); 25 vsnprintf(p, 256, fmt, ap); 26 va_end(ap); 27 28 if(daemonize) 29 syslog(10, "%s", p); 30 else 31 printf("%s", p); 32 } 33
This page was automatically generated by LXR 0.3.1. • OpenWrt