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

Doug Barton dougb at FreeBSD.org
Sun Nov 6 07:35:09 UTC 2011


Author: dougb
Date: Sun Nov  6 07:35:08 2011
New Revision: 227142
URL: http://svn.freebsd.org/changeset/base/227142

Log:
  MFC r227011:
  
  If the user is moving from any other time zone to UTC we need
  to delete any old /var/db/zoneinfo file that may exist so that
  tzsetup -r does the right thing.
  
  Approved by:	re (kensmith)

Modified:
  stable/9/usr.sbin/tzsetup/tzsetup.c
Directory Properties:
  stable/9/usr.sbin/tzsetup/   (props changed)

Modified: stable/9/usr.sbin/tzsetup/tzsetup.c
==============================================================================
--- stable/9/usr.sbin/tzsetup/tzsetup.c	Sun Nov  6 07:33:17 2011	(r227141)
+++ stable/9/usr.sbin/tzsetup/tzsetup.c	Sun Nov  6 07:35:08 2011	(r227142)
@@ -565,6 +565,18 @@ install_zoneinfo_file(const char *zonein
 
 				return (DITEM_FAILURE | DITEM_RECREATE);
 			}
+			if (unlink(path_db) < 0 && errno != ENOENT) {
+				snprintf(title, sizeof(title), "Error");
+				snprintf(prompt, sizeof(prompt),
+				     "Could not delete %s: %s", path_db,
+				     strerror(errno));
+				if (usedialog)
+					dialog_mesgbox(title, prompt, 8, 72);
+				else
+					fprintf(stderr, "%s\n", prompt);
+
+				return (DITEM_FAILURE | DITEM_RECREATE);
+			}
 			return (DITEM_LEAVE_MENU);
 		}
 		


More information about the svn-src-stable-9 mailing list