|
Lines 194-199
void
Link Here
|
| 194 |
log_init(char *av0, LogLevel level, SyslogFacility facility, int on_stderr) |
194 |
log_init(char *av0, LogLevel level, SyslogFacility facility, int on_stderr) |
| 195 |
{ |
195 |
{ |
| 196 |
argv0 = av0; |
196 |
argv0 = av0; |
|
|
197 |
#if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT) |
| 198 |
struct syslog_data sdata = SYSLOG_DATA_INIT; |
| 199 |
#endif |
| 197 |
|
200 |
|
| 198 |
switch (level) { |
201 |
switch (level) { |
| 199 |
case SYSLOG_LEVEL_QUIET: |
202 |
case SYSLOG_LEVEL_QUIET: |
|
Lines 261-266
log_init(char *av0, LogLevel level, Sysl
Link Here
|
| 261 |
(int) facility); |
264 |
(int) facility); |
| 262 |
exit(1); |
265 |
exit(1); |
| 263 |
} |
266 |
} |
|
|
267 |
|
| 268 |
/* |
| 269 |
* If an external library (eg libwrap) attempts to use syslog |
| 270 |
* immediately after reexec, syslog may be pointing to the wrong |
| 271 |
* facility, so we force an open/close of syslog here. |
| 272 |
*/ |
| 273 |
#if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT) |
| 274 |
openlog_r(argv0 ? argv0 : __progname, LOG_PID, log_facility, &sdata); |
| 275 |
closelog_r(&sdata); |
| 276 |
#else |
| 277 |
openlog(argv0 ? argv0 : __progname, LOG_PID, log_facility); |
| 278 |
closelog(); |
| 279 |
#endif |
| 264 |
} |
280 |
} |
| 265 |
|
281 |
|
| 266 |
#define MSGBUFSIZ 1024 |
282 |
#define MSGBUFSIZ 1024 |