From owner-svn-src-head@freebsd.org  Wed Jun  1 15:39:12 2016
Return-Path: <owner-svn-src-head@freebsd.org>
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E098B6171E;
 Wed,  1 Jun 2016 15:39:12 +0000 (UTC) (envelope-from smh@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 374AA18EC;
 Wed,  1 Jun 2016 15:39:12 +0000 (UTC) (envelope-from smh@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51FdBiS011182;
 Wed, 1 Jun 2016 15:39:11 GMT (envelope-from smh@FreeBSD.org)
Received: (from smh@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51FdB8J011181;
 Wed, 1 Jun 2016 15:39:11 GMT (envelope-from smh@FreeBSD.org)
Message-Id: <201606011539.u51FdB8J011181@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org
 using -f
From: Steven Hartland <smh@FreeBSD.org>
Date: Wed, 1 Jun 2016 15:39:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r301131 - head/usr.sbin/tzsetup
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 <svn-src-head.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-head>,
 <mailto:svn-src-head-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-head/>
List-Post: <mailto:svn-src-head@freebsd.org>
List-Help: <mailto:svn-src-head-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-head>,
 <mailto:svn-src-head-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 01 Jun 2016 15:39:12 -0000

Author: smh
Date: Wed Jun  1 15:39:11 2016
New Revision: 301131
URL: https://svnweb.freebsd.org/changeset/base/301131

Log:
  Fix tzsetup not installing /etc/localtime for UTC
  
  If tzsetup UTC is run then it successfully configured the system for UTC
  including installing /etc/localtime however if the user ran just tzsetup
  for interactive configuration and select UTC no /etc/localtime was installed
  which resulted in failures for utilities which require said file.
  
  Change set_zone_utc to call install_zoneinfo("UTC") to ensure that
  /etc/localtime is created for interactive UTC selection.
  
  Users who have previously run tzsetup in interactive mode and select UTC
  can install the missing /etc/localtime by running tzsetup -r.
  
  Also correct static miss-match for set_zone_utc.
  
  MFC after:	2 weeks
  Relnotes:	Yes
  Sponsored by:	Multiplay

Modified:
  head/usr.sbin/tzsetup/tzsetup.c

Modified: head/usr.sbin/tzsetup/tzsetup.c
==============================================================================
--- head/usr.sbin/tzsetup/tzsetup.c	Wed Jun  1 15:19:49 2016	(r301130)
+++ head/usr.sbin/tzsetup/tzsetup.c	Wed Jun  1 15:39:11 2016	(r301131)
@@ -199,6 +199,7 @@ static char *chrootenv = NULL;
 static void	usage(void);
 static int	confirm_zone(const char *filename);
 static int	continent_country_menu(dialogMenuItem *);
+static int	install_zoneinfo(const char *zoneinfo);
 static int	install_zoneinfo_file(const char *zoneinfo_file);
 static int	set_zone_multi(dialogMenuItem *);
 static int	set_zone_whole_country(dialogMenuItem *);
@@ -633,13 +634,13 @@ set_zone_menu(dialogMenuItem *dmi)
 	return (DITEM_LEAVE_MENU);
 }
 
-int
+static int
 set_zone_utc(void)
 {
 	if (!confirm_zone(NULL))
 		return (DITEM_FAILURE | DITEM_RECREATE);
 
-	return (install_zoneinfo_file(NULL));
+	return (install_zoneinfo("UTC"));
 }
 
 static int