svn commit: r240843 - head/usr.sbin/bsdconfig/timezone/share

Devin Teske devin.teske at fisglobal.com
Mon Sep 24 16:45:40 UTC 2012


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.


More information about the svn-src-all mailing list