home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / mod.std.unix.v1 / text0049.txt < prev    next >
Encoding:
Text File  |  1987-06-30  |  1.4 KB  |  45 lines

  1. ----------------------------------------------------------------------
  2.  
  3. From: Steve Glaser <steveg%hammer.TEK%tektronix.csnet@csnet-relay.arpa>
  4. To: tektronix!ut-sally!std-unix@tektronix.CSNET,
  5.         tektronix!std-unix%ut-sally.arpa@tektronix.CSNET
  6. Date: Mon, 5 Aug 85 17:58:33 PDT
  7. Subject: Re: standardized error messages
  8.  
  9. in Chris Torek's error example, please change:
  10.  
  11. >    if (e > 0) {
  12. >        p = e < sys_nerr ? sys_errlist[e] : "unknown error";
  13. >        (void) fprintf(stderr, ": %s", p);
  14. >    }
  15.  
  16. to:
  17.  
  18. >    if (e > 0) {
  19. >        if (e < sys_nerr)
  20. >            (void) fprintf(stderr, ": %s", sys_errlist[e]);
  21. >        else
  22. >            (void) fprintf(stderr, ": unknown error number %d", e);
  23. >    }
  24.  
  25. It's most annoying when an error message printing routine throws away
  26. information.  Especially when you have new error codes cropping up and
  27. programs that don't get recompiled (or at least relinked).
  28.  
  29. At least Chris checked against sys_nerr.  I've seen may programs that
  30. don't bother and end up printing gibberish when a new error comes along.
  31.  
  32.     Steve Glaser
  33.     tektronix!steveg
  34.  
  35. ------------------------------
  36.  
  37. Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.
  38. Submissions-To:    ut-sally!std-unix    or std-unix@ut-sally.ARPA
  39. Comments-To: ut-sally!std-unix-request    or std-unix-request@ut-sally.ARPA
  40. UUCP-Routes: {ihnp4,seismo,harvard,gatech}!ut-sally!std-unix
  41. Archives-In: ~ftp/pub/mod.std.unix on ut-sally.ARPA (soon sally.UTEXAS.EDU)
  42.  
  43. Volume-Number: Volume 1, Number 50
  44.  
  45.