home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / sgi / 18237 < prev    next >
Encoding:
Internet Message Format  |  1992-12-21  |  1.5 KB

  1. Xref: sparky comp.sys.sgi:18237 comp.sys.sgi.bugs:29 comp.unix.ultrix:8996
  2. Newsgroups: comp.sys.sgi,comp.sys.sgi.bugs,comp.unix.ultrix
  3. Path: sparky!uunet!caen!saimiri.primate.wisc.edu!usenet.coe.montana.edu!osyjm
  4. From: osyjm@cs.montana.edu (Jaye Mathisen)
  5. Subject: Re: tempnam(3S) bug, possibly on all MIPS
  6. Message-ID: <1992Dec20.233648.25068@coe.montana.edu>
  7. Sender: usenet@coe.montana.edu (USENET News System)
  8. Organization: CS
  9. References: <1gu849INNp6k@menudo.uh.edu> <BzIxqC.Ivv@world.std.com>
  10. Date: Sun, 20 Dec 1992 23:36:48 GMT
  11. Lines: 30
  12.  
  13. In article <BzIxqC.Ivv@world.std.com> cmr@world.std.com (Charles M Richmond) writes:
  14. >svec5@menudo.uh.edu (T.C. Zhao) writes:
  15. >
  16. >>It appears that tempnam(3S) is broken on three MIPS machines I have
  17. >>access to:   IRIX 3.3, Ultrix 4.1, UMIPS 4.52:
  18. >
  19. >>/* 
  20. >> * check to see if tempnam has the errno bug.
  21. >> */
  22. >>#include <stdio.h>
  23. >>#include <stdlib.h>
  24. >>#include <unistd.h>
  25. >>#include <errno.h>
  26. >
  27. >>int main(int argc, char **argv)
  28. >>{
  29. >>   char *p;
  30. >>   errno = 0;
  31. >>   p = tempnam(0, 0);
  32. >>   if(errno) fprintf(stderr," tempnam is broken\n");
  33. >>   return 0;
  34.  
  35. Looks to me like coding problems, you should check the return from tempnam
  36. first, then if it's an error, check errno.  As I recall, errno is only set 
  37. after an error, not if the call succeeds successfully.  Uh oh, some lousy
  38. english there... Oh well.
  39. -- 
  40.  Jaye Mathisen, COE Systems Manager                (406) 994-4780
  41.  410 Roberts Hall,Dept. of Computer Science
  42.  Montana State University,Bozeman MT 59717    osyjm@cs.montana.edu
  43.