29 |
int |
int |
30 |
init_log (void) |
init_log (void) |
31 |
{ |
{ |
32 |
int flags = 0; |
openlog ("pengfork", 0, LOG_DAEMON); |
33 |
|
return 0; |
|
#ifdef LOG_PERROR |
|
|
flags = LOG_PERROR; |
|
|
#endif |
|
|
openlog ("pengfork", flags, LOG_DAEMON); |
|
|
return 1; |
|
34 |
} |
} |
35 |
|
|
36 |
int |
int |
39 |
va_list ap; |
va_list ap; |
40 |
va_start (ap, format); |
va_start (ap, format); |
41 |
|
|
42 |
#ifndef LOG_ERROR |
if (!PARAM_DAEMON) |
43 |
vfprintf (stderr, format, ap); |
vfprintf (stderr, format, ap); |
44 |
#endif |
else |
45 |
syslog (level, format, ap); |
syslog (level, format, ap); |
46 |
return 0; |
return 0; |
47 |
} |
} |
48 |
|
|
53 |
|
|
54 |
va_start (ap, format); |
va_start (ap, format); |
55 |
if (level <= PARAM_DEBUG_LEVEL) |
if (level <= PARAM_DEBUG_LEVEL) |
56 |
vfprintf (stderr, format, ap); |
vfprintf (stdout, format, ap); |
57 |
|
|
58 |
return 0; |
return 0; |
59 |
} |
} |