home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / mint / mntlib24 / perror.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-08-03  |  372 b   |  23 lines

  1. /* originally from Dale Schumacher's dLibs */
  2.  
  3. /*
  4.  * standard "print error message" function
  5.  */
  6.  
  7. #include <stdio.h>
  8. #include <errno.h>
  9. #include <string.h>
  10.  
  11. void perror(msg)
  12.     const char *msg;
  13.     {
  14.     if(msg && *msg)
  15.         {
  16.         fputs(msg, stderr);
  17.         fputs(": ", stderr);
  18.         }
  19.     if((msg = strerror(errno)) != NULL)
  20.         fputs(msg, stderr);
  21.     fputs(".\n", stderr);
  22.     }
  23.