1/* 2 * our_syslog.h 3 * 4 * Syslog replacement functions 5 * 6 * $Id: our_syslog.h,v 1.1.1.1 2002/06/21 08:52:00 fenix_nl Exp $ 7 */ 8 9#ifndef _PPTPD_SYSLOG_H 10#define _PPTPD_SYSLOG_H 11 12/* 13 * only enable this if you are debugging and running by hand 14 * If init runs us you may not have an fd-2, and thus your write all over 15 * someones FD and the die :-( 16 */ 17#undef USE_STDERR 18 19#ifdef USE_STDERR 20 21/* 22 * Send all errors to stderr 23 */ 24 25#define openlog(a,b,c) ({}) 26#define syslog(a,b,c...) ({fprintf(stderr, "pptpd syslog: " b "\n" , ## c);}) 27#define closelog() ({}) 28 29#define syslog_perror perror 30 31#else 32 33/* 34 * Send all errors to syslog 35 */ 36 37#include <errno.h> 38#include <syslog.h> 39 40#define syslog_perror(s) syslog(LOG_ERR, "%s: %s", s, strerror(errno)) 41 42#endif 43 44#endif /* !_PPTPD_SYSLOG_H */ 45