File: our_syslog.h

package info (click to toggle)
pptpd 1.3.0-2etch2
  • links: PTS
  • area: main
  • in suites: etch
  • size: 1,036 kB
  • ctags: 856
  • sloc: ansic: 5,338; sh: 613; perl: 157; makefile: 130
file content (44 lines) | stat: -rw-r--r-- 781 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
 * our_syslog.h
 *
 * Syslog replacement functions
 *
 * $Id: our_syslog.h,v 1.1.1.1 2002/06/21 08:52:00 fenix_nl Exp $
 */

#ifndef _PPTPD_SYSLOG_H
#define _PPTPD_SYSLOG_H

/*
 *	only enable this if you are debugging and running by hand
 *	If init runs us you may not have an fd-2,  and thus your write all over
 *	someones FD and the die :-(
 */
#undef USE_STDERR

#ifdef USE_STDERR

/*
 *	Send all errors to stderr
 */

#define openlog(a,b,c) ({})
#define syslog(a,b,c...) ({fprintf(stderr, "pptpd syslog: " b "\n" , ## c);})
#define closelog() ({})

#define syslog_perror	perror

#else

/*
 * Send all errors to syslog
 */

#include <errno.h>
#include <syslog.h>

#define syslog_perror(s)	syslog(LOG_ERR, "%s: %s", s, strerror(errno))

#endif

#endif	/* !_PPTPD_SYSLOG_H */