Lines 50-55
Link Here
|
50 |
* Wed Aug 27 17:48:16 CEST 2003: Martin Schulze <joey@Infodrom.org> |
50 |
* Wed Aug 27 17:48:16 CEST 2003: Martin Schulze <joey@Infodrom.org> |
51 |
* Improved patch by Michael Pomraning <mjp@securepipe.com> to |
51 |
* Improved patch by Michael Pomraning <mjp@securepipe.com> to |
52 |
* reconnect klogd to the logger after it went away. |
52 |
* reconnect klogd to the logger after it went away. |
|
|
53 |
* |
54 |
* Tue Oct 26 20:32:44 GMT 2010 <sgf.dma@gmail.com> |
55 |
* Rename syslog() and vsyslog() to avoid conflicts with corresponding |
56 |
* C library's functions. |
53 |
*/ |
57 |
*/ |
54 |
|
58 |
|
55 |
#include <sys/types.h> |
59 |
#include <sys/types.h> |
Lines 75-80
Link Here
|
75 |
|
79 |
|
76 |
#define _PATH_LOGNAME "/dev/log" |
80 |
#define _PATH_LOGNAME "/dev/log" |
77 |
|
81 |
|
|
|
82 |
|
83 |
void syslog_own(int, const char *, ...); |
84 |
void vsyslog_own(int, const char *, va_list); |
85 |
|
78 |
static int LogFile = -1; /* fd for log */ |
86 |
static int LogFile = -1; /* fd for log */ |
79 |
static int connected; /* have done connect */ |
87 |
static int connected; /* have done connect */ |
80 |
static int LogStat = 0; /* status bits, set by openlog() */ |
88 |
static int LogStat = 0; /* status bits, set by openlog() */ |
Lines 82-98
Link Here
|
82 |
static int LogFacility = LOG_USER; /* default facility code */ |
90 |
static int LogFacility = LOG_USER; /* default facility code */ |
83 |
|
91 |
|
84 |
void |
92 |
void |
85 |
syslog(int pri, const char *fmt, ...) |
93 |
syslog_own(int pri, const char *fmt, ...) |
86 |
{ |
94 |
{ |
87 |
va_list ap; |
95 |
va_list ap; |
88 |
|
96 |
|
89 |
va_start(ap, fmt); |
97 |
va_start(ap, fmt); |
90 |
vsyslog(pri, fmt, ap); |
98 |
vsyslog_own(pri, fmt, ap); |
91 |
va_end(ap); |
99 |
va_end(ap); |
92 |
} |
100 |
} |
93 |
|
101 |
|
94 |
void |
102 |
void |
95 |
vsyslog(pri, fmt, ap) |
103 |
vsyslog_own(pri, fmt, ap) |
96 |
int pri; |
104 |
int pri; |
97 |
const char *fmt; |
105 |
const char *fmt; |
98 |
va_list ap; |
106 |
va_list ap; |