aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2012-01-18 04:12:32 +0000
committerEd Maste <emaste@FreeBSD.org>2012-01-18 04:12:32 +0000
commite2027608721c75259448b9d4456ae50f840804ae (patch)
tree5d3c8b1805b90a95eb05c9d11e4c6ca2e073e9ce /usr.sbin
parent555f3962854e00c9be4f20369af19d00d7633a7e (diff)
downloadsrc-e2027608721c75259448b9d4456ae50f840804ae.tar.gz
src-e2027608721c75259448b9d4456ae50f840804ae.zip
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
Notes
Notes: svn path=/head/; revision=230296
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/tzsetup/tzsetup.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/tzsetup/tzsetup.c b/usr.sbin/tzsetup/tzsetup.c
index 52824cd55576..d68ded3f85c9 100644
--- a/usr.sbin/tzsetup/tzsetup.c
+++ b/usr.sbin/tzsetup/tzsetup.c
@@ -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);