From owner-svn-src-head@FreeBSD.ORG Mon Sep 24 17:00:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBAFF1065677; Mon, 24 Sep 2012 17:00:37 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ie0-f182.google.com (mail-ie0-f182.google.com [209.85.223.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4D5488FC12; Mon, 24 Sep 2012 17:00:37 +0000 (UTC) Received: by ieak10 with SMTP id k10so11748402iea.13 for ; Mon, 24 Sep 2012 10:00:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=BggDEKjh7q+zyRCrEUkbzIB66N5bpvId3HvuvhIcO6M=; b=oxRQzFR70Eq6oQH5h6R5PBaGktZXkpgK3wrna1xg3MsnGpl3qOlNx1UqmAQIcMelih BMfZaq4F/YB0LeN3y56hAFazA3HZYQdfoEVizZPRUZD11pzNNLpkA5G42vdQl/aprKA4 DA9fHTgm50srXaNFLTRVi3LFOTEvCSn7DVYHR5K9MmrtUL+AmvM5jiwm4oXVTEyp5Oui XON3MI/Wz+sZ40O/+KSMOh/uRZYQSzmECL4gGTpWdvqr/QOX/hm8sRa5C/H6is0g9T8f 5cw/tW30dZD9Jqc5OKasbsIeuvytnk3enNuKZwJg1/BVAayI1sj3qV9LAV605wxDVUw4 ntgg== MIME-Version: 1.0 Received: by 10.50.173.41 with SMTP id bh9mr5778963igc.52.1348506036747; Mon, 24 Sep 2012 10:00:36 -0700 (PDT) Received: by 10.64.51.39 with HTTP; Mon, 24 Sep 2012 10:00:36 -0700 (PDT) In-Reply-To: References: <201209222216.q8MMG7w2053948@svn.freebsd.org> <505FCFED.2000101@FreeBSD.org> Date: Mon, 24 Sep 2012 10:00:36 -0700 Message-ID: From: Garrett Cooper To: Devin Teske Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Doug Barton , src-committers@freebsd.org Subject: Re: svn commit: r240843 - head/usr.sbin/bsdconfig/timezone/share X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Sep 2012 17:00:37 -0000 On Mon, Sep 24, 2012 at 9:45 AM, Devin Teske 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