summaryrefslogtreecommitdiff
path: root/usr.sbin/tzsetup/tzsetup.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/tzsetup/tzsetup.c')
-rw-r--r--usr.sbin/tzsetup/tzsetup.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/usr.sbin/tzsetup/tzsetup.c b/usr.sbin/tzsetup/tzsetup.c
index 6a74c1331365..bb4567ca6f82 100644
--- a/usr.sbin/tzsetup/tzsetup.c
+++ b/usr.sbin/tzsetup/tzsetup.c
@@ -648,11 +648,14 @@ main(int argc, char **argv)
dialog_utc = dialog_noyes;
#endif
- while ((c = getopt(argc, argv, "n")) != -1) {
+ while ((c = getopt(argc, argv, "ns")) != -1) {
switch(c) {
case 'n':
reallydoit = 0;
break;
+ case 's':
+ dialog_utc = NULL;
+ break;
default:
usage();
@@ -671,22 +674,25 @@ main(int argc, char **argv)
make_menus();
init_dialog();
- if (!dialog_utc("Select local or UTC (Greenwich Mean Time) clock",
- "Is this machine's CMOS clock set to UTC? If it is set to local time,\n"
- "or you don't know, please choose NO here!", 7, 72)) {
- if (reallydoit)
- unlink(_PATH_WALL_CMOS_CLOCK);
- } else {
- if (reallydoit) {
- fd = open(_PATH_WALL_CMOS_CLOCK,
- O_WRONLY|O_CREAT|O_TRUNC,
- S_IRUSR|S_IRGRP|S_IROTH);
- if (fd < 0)
- err(1, "create %s", _PATH_WALL_CMOS_CLOCK);
- close(fd);
+ if (dialog_utc != NULL) {
+ if (!dialog_utc("Select local or UTC (Greenwich Mean Time) clock",
+ "Is this machine's CMOS clock set to UTC? If it is set to local time,\n"
+ "or you don't know, please choose NO here!", 7, 72)) {
+ if (reallydoit)
+ unlink(_PATH_WALL_CMOS_CLOCK);
+ } else {
+ if (reallydoit) {
+ fd = open(_PATH_WALL_CMOS_CLOCK,
+ O_WRONLY|O_CREAT|O_TRUNC,
+ S_IRUSR|S_IRGRP|S_IROTH);
+ if (fd < 0)
+ err(1, "create %s",
+ _PATH_WALL_CMOS_CLOCK);
+ close(fd);
+ }
}
+ dialog_clear_norefresh();
}
- dialog_clear_norefresh();
if (optind == argc - 1) {
char *msg;
asprintf(&msg, "\nUse the default `%s' zone?", argv[optind]);