Date: Sun, 6 Nov 2011 07:43:57 +0000 (UTC) From: Doug Barton <dougb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r227144 - stable/8/usr.sbin/tzsetup Message-ID: <201111060743.pA67hvmF006392@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111060743.pA67hvmF006392>