home *** CD-ROM | disk | FTP | other *** search
/ kermit.columbia.edu / kermit.columbia.edu.tar / kermit.columbia.edu / sredird / telnetcpcd-1.09.tar.gz / telnetcpcd-1.09.tar / syslog_perror.c < prev    next >
C/C++ Source or Header  |  2003-08-12  |  429b  |  27 lines

  1. /*
  2.     syslog_perror.c
  3.  
  4.     Copyright (c) 2002,2003 Thomas J Pinkl <tom@pinkl.com>
  5.  
  6.     Version 1.00    12/03/2001
  7. */
  8.  
  9. #include "telnetcpcd.h"
  10.  
  11. /*
  12.     write the error message for the current system error to 
  13.     the syslog
  14. */
  15. void syslog_perror(char *str)
  16. {
  17.     extern int errno;
  18.  
  19.     if (errno > 0) {
  20.         if ((str == NULL) || (*str == '\0')) {
  21.             syslog(LOG_ERR,"%s",strerror(errno));
  22.         } else {
  23.             syslog(LOG_ERR,"%s: %s",str,strerror(errno));
  24.         }
  25.     }
  26. }
  27.