Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107824159
D19550.id54944.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D19550.id54944.diff
View Options
Index: bin/date/date.c
===================================================================
--- bin/date/date.c
+++ bin/date/date.c
@@ -91,14 +91,12 @@
int
main(int argc, char *argv[])
{
- struct timezone tz;
int ch, rflag;
bool Iflag, jflag, nflag, Rflag;
const char *format;
char buf[1024];
char *endptr, *fmt;
char *tmp;
- int set_timezone;
struct vary *v;
const struct vary *badv;
struct tm *lt;
@@ -108,18 +106,10 @@
v = NULL;
fmt = NULL;
(void) setlocale(LC_TIME, "");
- tz.tz_dsttime = tz.tz_minuteswest = 0;
rflag = 0;
Iflag = jflag = nflag = Rflag = 0;
- set_timezone = 0;
- while ((ch = getopt(argc, argv, "d:f:I::jnRr:t:uv:")) != -1)
+ while ((ch = getopt(argc, argv, "f:I::jnRr:uv:")) != -1)
switch((char)ch) {
- case 'd': /* daylight savings time */
- tz.tz_dsttime = strtol(optarg, &endptr, 10) ? 1 : 0;
- if (endptr == optarg || *endptr != '\0')
- usage();
- set_timezone = 1;
- break;
case 'f':
fmt = optarg;
break;
@@ -160,13 +150,6 @@
usage();
}
break;
- case 't': /* minutes west of UTC */
- /* error check; don't allow "PST" */
- tz.tz_minuteswest = strtol(optarg, &endptr, 10);
- if (endptr == optarg || *endptr != '\0')
- usage();
- set_timezone = 1;
- break;
case 'u': /* do everything in UTC */
(void)setenv("TZ", "UTC0", 1);
break;
@@ -179,13 +162,6 @@
argc -= optind;
argv += optind;
- /*
- * If -d or -t, set the timezone or daylight savings time; this
- * doesn't belong here; the kernel should not know about either.
- */
- if (set_timezone && settimeofday(NULL, &tz) != 0)
- err(1, "settimeofday (timezone)");
-
if (!rflag && time(&tval) == -1)
err(1, "time");
@@ -411,8 +387,7 @@
usage(void)
{
(void)fprintf(stderr, "%s\n%s\n%s\n",
- "usage: date [-jnRu] [-d dst] [-r seconds|file] [-t west] "
- "[-v[+|-]val[ymwdHMS]]",
+ "usage: date [-jnRu] [-r seconds|file] [-v[+|-]val[ymwdHMS]]",
" "
"[-I[date | hours | minutes | seconds]]",
" "
Index: sys/amd64/linux32/linux32_machdep.c
===================================================================
--- sys/amd64/linux32/linux32_machdep.c
+++ sys/amd64/linux32/linux32_machdep.c
@@ -674,8 +674,8 @@
error = copyout(&atv32, uap->tp, sizeof(atv32));
}
if (error == 0 && uap->tzp != NULL) {
- rtz.tz_minuteswest = tz_minuteswest;
- rtz.tz_dsttime = tz_dsttime;
+ rtz.tz_minuteswest = 0;
+ rtz.tz_dsttime = 0;
error = copyout(&rtz, uap->tzp, sizeof(rtz));
}
return (error);
Index: sys/compat/freebsd32/freebsd32_misc.c
===================================================================
--- sys/compat/freebsd32/freebsd32_misc.c
+++ sys/compat/freebsd32/freebsd32_misc.c
@@ -834,8 +834,8 @@
error = copyout(&atv32, uap->tp, sizeof (atv32));
}
if (error == 0 && uap->tzp != NULL) {
- rtz.tz_minuteswest = tz_minuteswest;
- rtz.tz_dsttime = tz_dsttime;
+ rtz.tz_minuteswest = 0;
+ rtz.tz_dsttime = 0;
error = copyout(&rtz, uap->tzp, sizeof (rtz));
}
return (error);
Index: sys/kern/kern_time.c
===================================================================
--- sys/kern/kern_time.c
+++ sys/kern/kern_time.c
@@ -660,8 +660,8 @@
error = copyout(&atv, uap->tp, sizeof (atv));
}
if (error == 0 && uap->tzp != NULL) {
- rtz.tz_minuteswest = tz_minuteswest;
- rtz.tz_dsttime = tz_dsttime;
+ rtz.tz_minuteswest = 0;
+ rtz.tz_dsttime = 0;
error = copyout(&rtz, uap->tzp, sizeof (rtz));
}
return (error);
@@ -713,10 +713,6 @@
return (EINVAL);
error = settime(td, tv);
}
- if (tzp && error == 0) {
- tz_minuteswest = tzp->tz_minuteswest;
- tz_dsttime = tzp->tz_dsttime;
- }
return (error);
}
Index: sys/kern/subr_clock.c
===================================================================
--- sys/kern/subr_clock.c
+++ sys/kern/subr_clock.c
@@ -52,9 +52,6 @@
#include <sys/sysctl.h>
#include <sys/timetc.h>
-int tz_minuteswest;
-int tz_dsttime;
-
/*
* The adjkerntz and wall_cmos_clock sysctls are in the "machdep" sysctl
* namespace because they were misplaced there originally.
@@ -386,5 +383,5 @@
utc_offset(void)
{
- return (tz_minuteswest * 60 + (wall_cmos_clock ? adjkerntz : 0));
+ return (wall_cmos_clock ? adjkerntz : 0);
}
Index: sys/sys/clock.h
===================================================================
--- sys/sys/clock.h
+++ sys/sys/clock.h
@@ -51,12 +51,6 @@
#ifdef _KERNEL /* No user serviceable parts */
-/*
- * Timezone info from settimeofday(2), usually not used
- */
-extern int tz_minuteswest;
-extern int tz_dsttime;
-
int utc_offset(void);
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 19, 1:03 PM (13 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15941661
Default Alt Text
D19550.id54944.diff (4 KB)
Attached To
Mode
D19550: Kill tz_minuteswest and tz_dsttime.
Attached
Detach File
Event Timeline
Log In to Comment