Author: dteske
Date: Mon Mar  4 01:35:56 2013
New Revision: 247748
URL: http://svnweb.freebsd.org/changeset/base/247748

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/8/usr.sbin/tzsetup/tzsetup.c

Modified: stable/8/usr.sbin/tzsetup/tzsetup.c
==============================================================================
--- stable/8/usr.sbin/tzsetup/tzsetup.c Mon Mar  4 01:32:24 2013        
(r247747)
+++ stable/8/usr.sbin/tzsetup/tzsetup.c Mon Mar  4 01:35:56 2013        
(r247748)
@@ -721,9 +721,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);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to