diff options
author | emaste <emaste@FreeBSD.org> | 2012-01-18 04:37:35 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2012-01-18 04:37:35 +0000 |
commit | 168320bee8b5bf39a629ef8ad729b1b4c4bd8349 (patch) | |
tree | 3f80ed7a5d2138d457b795905af82e39d6bb30bb /usr.sbin | |
parent | b955b33d3ab6152aae4d966a3dd5d954c90f57c8 (diff) | |
download | FreeBSD-src-168320bee8b5bf39a629ef8ad729b1b4c4bd8349.zip FreeBSD-src-168320bee8b5bf39a629ef8ad729b1b4c4bd8349.tar.gz |
Fix #ifdef VERBOSE for UTC case
Update verbose output to match what actually happens when selecting
the UTC option, and when the -n option is used.
Patch updated slightly for new libdialog.
PR: bin/164042
Submitted by: Devin Teske <dteske vicor com>
MFC after: 2 weeks
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/tzsetup/tzsetup.c | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/usr.sbin/tzsetup/tzsetup.c b/usr.sbin/tzsetup/tzsetup.c index d68ded3..3219439 100644 --- a/usr.sbin/tzsetup/tzsetup.c +++ b/usr.sbin/tzsetup/tzsetup.c @@ -659,16 +659,19 @@ install_zoneinfo_file(const char *zoneinfo_file) copymode = 1; #ifdef VERBOSE - if (copymode) + snprintf(title, sizeof(title), "Info"); + if (zoneinfo_file == NULL) + snprintf(prompt, sizeof(prompt), + "Removing %s", path_localtime); + else if (copymode) snprintf(prompt, sizeof(prompt), "Copying %s to %s", zoneinfo_file, path_localtime); else snprintf(prompt, sizeof(prompt), "Creating symbolic link %s to %s", - path_localtime, - zoneinfo_file == NULL ? "(UTC)" : zoneinfo_file); + path_localtime, zoneinfo_file); if (usedialog) - dialog_notify(prompt); + dialog_msgbox(title, prompt, 8, 72, 1); else fprintf(stderr, "%s\n", prompt); #endif @@ -699,6 +702,10 @@ install_zoneinfo_file(const char *zoneinfo_file) return (DITEM_FAILURE | DITEM_RECREATE); } +#ifdef VERBOSE + snprintf(prompt, sizeof(prompt), + "Removed %s", path_localtime); +#endif return (DITEM_LEAVE_MENU); } @@ -797,23 +804,23 @@ install_zoneinfo_file(const char *zoneinfo_file) return (DITEM_FAILURE | DITEM_RECREATE); } } - } #ifdef VERBOSE - snprintf(title, sizeof(title), "Done"); - if (copymode) - snprintf(prompt, sizeof(prompt), - "Copied timezone file from %s to %s", zoneinfo_file, - path_localtime); - else - snprintf(prompt, sizeof(prompt), - "Created symbolic link from %s to %s", zoneinfo_file, - path_localtime); - if (usedialog) - dialog_msgbox(title, prompt, 8, 72, 1); - else - fprintf(stderr, "%s\n", prompt); + snprintf(title, sizeof(title), "Done"); + if (copymode) + snprintf(prompt, sizeof(prompt), + "Copied timezone file from %s to %s", + zoneinfo_file, path_localtime); + else + snprintf(prompt, sizeof(prompt), + "Created symbolic link from %s to %s", + zoneinfo_file, path_localtime); + if (usedialog) + dialog_msgbox(title, prompt, 8, 72, 1); + else + fprintf(stderr, "%s\n", prompt); #endif + } /* reallydoit */ return (DITEM_LEAVE_MENU); } |