svn commit: r230296 - head/usr.sbin/tzsetup

Ed Maste emaste at FreeBSD.org
Wed Jan 18 04:12:33 UTC 2012


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);


More information about the svn-src-all mailing list