On Sep 23, 2012, at 8:13 PM, Doug Barton wrote:

> On 09/22/2012 15:16, Devin Teske wrote:
>> -            if : 2> /dev/null > "$_PATH_DB"; then
>> +            if true 2> /dev/null > "$_PATH_DB"; then
>>                      cat <<-EOF > "$_PATH_DB"
>>                      $zoneinfo
>>                      EOF
> 
> Is there a reason you're not using mktemp here?
> 

Hi Doug,

There is indeed a reason that mktemp is not used in this situation.

1. No possibility of a race condition, so little-to-no need for mktemp.
2. Using mktemp in a "file-truncate operation" would just be "wrong" (quoting 
others).
-- 
Devin

P.S. I posited your question to IRC to see what general consensus was and many 
agreed that mktemp is not right in this situation.

_____________
The information contained in this message is proprietary and/or confidential. 
If you are not the intended recipient, please: (i) delete the message and all 
copies; (ii) do not disclose, distribute or use the message in any manner; and 
(iii) notify the sender immediately. In addition, please be aware that any 
message addressed to our domain is subject to archiving and review by persons 
other than the intended recipient. Thank you.
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to