summaryrefslogtreecommitdiffstats
path: root/usr.sbin/tzsetup
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>1997-10-27 07:49:47 +0000
committercharnier <charnier@FreeBSD.org>1997-10-27 07:49:47 +0000
commit8098c0d2f30fd6d4a73388d0802857a62f565edd (patch)
tree6aaf76b5ef258503d2f0b28036797d0ec4d7e931 /usr.sbin/tzsetup
parent8d124fec07a9cc63b694dc8a24bb3295138e93eb (diff)
downloadFreeBSD-src-8098c0d2f30fd6d4a73388d0802857a62f565edd.zip
FreeBSD-src-8098c0d2f30fd6d4a73388d0802857a62f565edd.tar.gz
Add usage(). Document -n flag. Do not touch/remove /etc/wall_cmos_clock
when -n (do nothing) is used.
Diffstat (limited to 'usr.sbin/tzsetup')
-rw-r--r--usr.sbin/tzsetup/tzsetup.819
-rw-r--r--usr.sbin/tzsetup/tzsetup.c30
2 files changed, 34 insertions, 15 deletions
diff --git a/usr.sbin/tzsetup/tzsetup.8 b/usr.sbin/tzsetup/tzsetup.8
index 5f4cbee..8841959 100644
--- a/usr.sbin/tzsetup/tzsetup.8
+++ b/usr.sbin/tzsetup/tzsetup.8
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: tzsetup.8,v 1.6 1997/02/22 16:14:05 peter Exp $
+.\" $Id: tzsetup.8,v 1.7 1997/06/23 04:52:11 steve Exp $
.Dd January 24, 1996
.Dt TZSETUP 8
@@ -32,12 +32,22 @@
.Nm tzsetup
.Nd set local timezone
-.Sh DESCRIPTION
+.Sh SYNOPSIS
.Nm tzsetup
+.Op Fl n
+
+.Sh DESCRIPTION
+.Nm Tzsetup
is a menu based program to set your local time zone. Pick the continent
and a city (e.g. your capital) that best describes your location and
-.Nm tzsetup
+.Nm
do all the work for you.
+.Pp
+The following option is available:
+.Bl -tag -width indent
+.It Fl n
+Do not really do anything.
+.El
.Sh BUGS
You need to reboot the machine for changes to take effect.
@@ -49,7 +59,8 @@ current time zone file
.It Pa /usr/share/zoneinfo
directory for zoneinfo files
.It Pa /etc/wall_cmos_clock
-see adjkerntz(8).
+see
+.Xr adjkerntz 8 .
.El
.Sh SEE ALSO
diff --git a/usr.sbin/tzsetup/tzsetup.c b/usr.sbin/tzsetup/tzsetup.c
index 7a77cdb..da8d9ee 100644
--- a/usr.sbin/tzsetup/tzsetup.c
+++ b/usr.sbin/tzsetup/tzsetup.c
@@ -25,8 +25,6 @@
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id$
*/
/*
@@ -34,6 +32,11 @@
* files provided in newer tzdata releases.
*/
+#ifndef lint
+static const char rcsid[] =
+ "$Id$";
+#endif /* not lint */
+
#include <sys/types.h>
#include <dialog.h>
#include <err.h>
@@ -618,6 +621,13 @@ set_zone_whole_country(dialogMenuItem *dmi)
return rv;
}
+static void
+usage()
+{
+ fprintf(stderr, "usage: tzsetup [-n]\n");
+ exit(1);
+}
+
int
main(int argc, char **argv)
{
@@ -630,16 +640,12 @@ main(int argc, char **argv)
break;
default:
- fprintf(stderr, "%s: usage:\n\t%s [-n]\n", argv[0],
- argv[0]);
- exit(1);
+ usage();
}
}
- if (optind != argc) {
- fprintf(stderr, "%s: usage:\n\t%s [-n]\n", argv[0], argv[0]);
- exit(1);
- }
+ if (optind != argc)
+ usage();
read_iso3166_table();
read_zones();
@@ -650,9 +656,11 @@ main(int argc, char **argv)
if (!dialog_yesno("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"
"please choose NO here!", 7, 72))
- system("rm -f /etc/wall_cmos_clock");
+ if (reallydoit)
+ system("rm -f /etc/wall_cmos_clock");
else
- system("touch /etc/wall_cmos_clock");
+ if (reallydoit)
+ system("touch /etc/wall_cmos_clock");
dialog_clear_norefresh();
dialog_menu("Time Zone Selector", "Select a region", -1, -1,
NCONTINENTS, -NCONTINENTS, continents, 0, NULL, NULL);
OpenPOWER on IntegriCloud