svn commit: r247728 - stable/9/usr.sbin/tzsetup

Devin Teske dteske at FreeBSD.org
Sun Mar 3 19:26:06 UTC 2013


Author: dteske
Date: Sun Mar  3 19:26:05 2013
New Revision: 247728
URL: http://svnweb.freebsd.org/changeset/base/247728

Log:
  MFC r230296:
  
  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:	dteske

Modified:
  stable/9/usr.sbin/tzsetup/tzsetup.c

Modified: stable/9/usr.sbin/tzsetup/tzsetup.c
==============================================================================
--- stable/9/usr.sbin/tzsetup/tzsetup.c	Sun Mar  3 19:20:30 2013	(r247727)
+++ stable/9/usr.sbin/tzsetup/tzsetup.c	Sun Mar  3 19:26:05 2013	(r247728)
@@ -836,9 +836,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