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