On Mon, Sep 24, 2012 at 9:45 AM, Devin Teske <[email protected]> wrote:
>
> 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).
>
> 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.
Indeed. It's either going to pass (truncate the file) or fail. No
sense in using a temporary file here.
Thanks,
-Garrett
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"