From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 6 07:43:57 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6380106566B; Sun, 6 Nov 2011 07:43:57 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D50D98FC12; Sun, 6 Nov 2011 07:43:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA67hv17006394; Sun, 6 Nov 2011 07:43:57 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA67hvmF006392; Sun, 6 Nov 2011 07:43:57 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201111060743.pA67hvmF006392@svn.freebsd.org> From: Doug Barton Date: Sun, 6 Nov 2011 07:43:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227144 - stable/8/usr.sbin/tzsetup X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 07:43:58 -0000 Author: dougb Date: Sun Nov 6 07:43:57 2011 New Revision: 227144 URL: http://svn.freebsd.org/changeset/base/227144 Log: MFC 227011: If the user is moving from any other time zone to UTC we need to delete any old /var/db/zoneinfo file that may exist so that tzsetup -r does the right thing. Modified: stable/8/usr.sbin/tzsetup/tzsetup.c Directory Properties: stable/8/usr.sbin/tzsetup/ (props changed) Modified: stable/8/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- stable/8/usr.sbin/tzsetup/tzsetup.c Sun Nov 6 07:43:00 2011 (r227143) +++ stable/8/usr.sbin/tzsetup/tzsetup.c Sun Nov 6 07:43:57 2011 (r227144) @@ -565,6 +565,18 @@ install_zoneinfo_file(const char *zonein return (DITEM_FAILURE | DITEM_RECREATE); } + if (unlink(path_db) < 0 && errno != ENOENT) { + snprintf(title, sizeof(title), "Error"); + snprintf(prompt, sizeof(prompt), + "Could not delete %s: %s", path_db, + strerror(errno)); + if (usedialog) + dialog_mesgbox(title, prompt, 8, 72); + else + fprintf(stderr, "%s\n", prompt); + + return (DITEM_FAILURE | DITEM_RECREATE); + } return (DITEM_LEAVE_MENU); }