Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Apr 2000 07:00:02 -0700 (PDT)
From:      Daniel Hagan <dhagan@cs.vt.edu>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/16924: tmpfile(3) ignores TMPDIR and always uses /tmp
Message-ID:  <200004061400.HAA39935@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/16924; it has been noted by GNATS.

From: Daniel Hagan <dhagan@cs.vt.edu>
To: "Lachlan O'Dea" <lodea@vet.com.au>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: bin/16924: tmpfile(3) ignores TMPDIR and always uses /tmp
Date: Thu, 6 Apr 2000 09:56:33 -0400 (EDT)

 On Thu, 6 Apr 2000, Lachlan O'Dea wrote:
 
 > Thanks for looking at this. I wanted to include error checking, but I
 > wasn't sure of what action to take if an error occurred. I remember
 > finding some other malloc calls in libc that didn't check for errors, so
 > I just left it alone. If anyone can point me to an example of how to
 > handle this, I'd appreciate it.
 
 From the information given in the man page for tmpfile(3), it would appear
 that the correct way to handle a malloc failure would be to return null
 and leave errno set to whatever value malloc(3) put there.  See the RETURN
 VALUES and ERRORS section of the tmpfile(3) manpage.
 
 The original code is incorrect anyway since it doesn't handle malloc
 errors.
 
 Daniel
 
 -- 
 Daniel Hagan                                             Computer Science CSE
 dhagan@cs.vt.edu                                http://www.cs.vt.edu/~dhagan/
 
 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200004061400.HAA39935>