Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Jan 2012 04:12:32 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r230296 - head/usr.sbin/tzsetup
Message-ID:  <201201180412.q0I4CWV4021731@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Wed Jan 18 04:12:32 2012
New Revision: 230296
URL: http://svn.freebsd.org/changeset/base/230296

Log:
  Don't write /var/db/zoneinfo when zone is not actually changed.
  
  If the specified zone file does not exist or the -n flag is specified,
  do not update /var/db/zoneinfo.
  
  PR:		bin/164039
  Submitted by:	Devin Teske <dteske vicor com>
  MFC after:	1 week

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

Modified: head/usr.sbin/tzsetup/tzsetup.c
==============================================================================
--- head/usr.sbin/tzsetup/tzsetup.c	Wed Jan 18 03:07:34 2012	(r230295)
+++ head/usr.sbin/tzsetup/tzsetup.c	Wed Jan 18 04:12:32 2012	(r230296)
@@ -829,9 +829,11 @@ install_zoneinfo(const char *zoneinfo)
 	rv = install_zoneinfo_file(path_zoneinfo_file);
 
 	/* Save knowledge for later */
-	if ((f = fopen(path_db, "w")) != NULL) {
-		fprintf(f, "%s\n", zoneinfo);
-		fclose(f);
+	if (reallydoit && (rv & DITEM_FAILURE) == 0) {
+		if ((f = fopen(path_db, "w")) != NULL) {
+			fprintf(f, "%s\n", zoneinfo);
+			fclose(f);
+		}
 	}
 
 	return (rv);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201180412.q0I4CWV4021731>