summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorDavid Leonard <d@cvs.openbsd.org>2000-01-08 23:23:38 +0000
committerDavid Leonard <d@cvs.openbsd.org>2000-01-08 23:23:38 +0000
commit4dc30ea10149bdf88cbb716fedfc6385ee8413f1 (patch)
tree9d9e8e30a982fd13167586adbf966ec3db48e1e5 /sys/kern
parent044607b6cf8a6b0f7d82eab78c63098e49c31e51 (diff)
Allow UKC to change tz with 'timezone' command.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_userconf.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/sys/kern/subr_userconf.c b/sys/kern/subr_userconf.c
index acfe9fba81d..d449812eef4 100644
--- a/sys/kern/subr_userconf.c
+++ b/sys/kern/subr_userconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_userconf.c,v 1.18 1999/10/04 20:04:31 deraadt Exp $ */
+/* $OpenBSD: subr_userconf.c,v 1.19 2000/01/08 23:23:37 d Exp $ */
/*
* Copyright (c) 1996 Mats O Jansson <moj@stacken.kth.se>
@@ -36,6 +36,7 @@
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/malloc.h>
+#include <sys/time.h>
#include <dev/cons.h>
@@ -45,6 +46,7 @@ extern short cfroots[];
extern int cfroots_size;
extern int pv_size;
extern short pv[];
+extern struct timezone tz;
int userconf_base = 16; /* Base for "large" numbers */
int userconf_maxdev = -1; /* # of used device slots */
@@ -106,6 +108,7 @@ char *userconf_cmds[] = {
"lines", "L",
"quit", "q",
"show", "s",
+ "timezone", "t",
"verbose", "v",
"?", "h",
"", "",
@@ -644,6 +647,9 @@ userconf_help()
printf("[attr [val]] %s",
"show attributes (or devices with an attribute)");
break;
+ case 't':
+ printf("[mins [dst]] set timezone/dst");
+ break;
case 'v':
printf(" toggle verbose booting");
break;
@@ -1184,6 +1190,28 @@ userconf_parse(cmd)
else
userconf_show_attr(c);
break;
+ case 't':
+ if (*c == '\0' || userconf_number(c, &a) == 0) {
+ if (*c != '\0') {
+ tz.tz_minuteswest = a;
+ while (*c != '\n' && *c != '\t' &&
+ *c != ' ' && *c != '\0')
+ c++;
+ while (*c == '\t' || *c == ' ')
+ c++;
+ if (*c != '\0' &&
+ userconf_number(c, &a) == 0)
+ tz.tz_dsttime = a;
+ userconf_hist_cmd('t');
+ userconf_hist_int(tz.tz_minuteswest);
+ userconf_hist_int(tz.tz_dsttime);
+ userconf_hist_eoc();
+ }
+ printf("timezone = %d, dst = %d\n",
+ tz.tz_minuteswest, tz.tz_dsttime);
+ } else
+ printf("Unknown argument\n");
+ break;
case 'v':
autoconf_verbose = !autoconf_verbose;
printf("autoconf verbose %sabled\n",