summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorAttilio Rao <attilio@FreeBSD.org>2009-09-07 08:46:26 +0000
committerAttilio Rao <attilio@FreeBSD.org>2009-09-07 08:46:26 +0000
commit1b5e7b152c7e36c8fd897c211e99e8d1c445fc93 (patch)
tree37566d6d6788c47a0a510926d2c5a8051bc584f9 /usr.sbin
parentd169e9cb3a450758788a6d7ce51ba7b65751bdc0 (diff)
Notes
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/tzsetup/tzsetup.87
-rw-r--r--usr.sbin/tzsetup/tzsetup.c36
2 files changed, 26 insertions, 17 deletions
diff --git a/usr.sbin/tzsetup/tzsetup.8 b/usr.sbin/tzsetup/tzsetup.8
index 562744c6b686..8a7445ed4963 100644
--- a/usr.sbin/tzsetup/tzsetup.8
+++ b/usr.sbin/tzsetup/tzsetup.8
@@ -23,7 +23,7 @@
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD$
-.Dd January 24, 1996
+.Dd September 05, 2009
.Dt TZSETUP 8
.Os
.Sh NAME
@@ -31,7 +31,7 @@
.Nd set local timezone
.Sh SYNOPSIS
.Nm
-.Op Fl n
+.Op Fl ns
.Op Ar default
.Sh DESCRIPTION
The
@@ -51,6 +51,9 @@ The following option is available:
.Bl -tag -offset indent -width Fl
.It Fl n
Do not create or copy files.
+.It Fl s
+Skip the initial question about adjusting the clock if not set to
+.Tn UTC .
.El
.Pp
It is possible to short-circuit the menu system by specifying a
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]);