our_syslog.h 781 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. #ifndef _PPTPD_SYSLOG_H
  9. #define _PPTPD_SYSLOG_H
  10. /*
  11. * only enable this if you are debugging and running by hand
  12. * If init runs us you may not have an fd-2, and thus your write all over
  13. * someones FD and the die :-(
  14. */
  15. #undef USE_STDERR
  16. #ifdef USE_STDERR
  17. /*
  18. * Send all errors to stderr
  19. */
  20. #define openlog(a,b,c) ({})
  21. #define syslog(a,b,c...) ({fprintf(stderr, "pptpd syslog: " b "\n" , ## c);})
  22. #define closelog() ({})
  23. #define syslog_perror perror
  24. #else
  25. /*
  26. * Send all errors to syslog
  27. */
  28. #include <errno.h>
  29. #include <syslog.h>
  30. #define syslog_perror(s) syslog(LOG_ERR, "%s: %s", s, strerror(errno))
  31. #endif
  32. #endif /* !_PPTPD_SYSLOG_H */