projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ualarm
[unix-history]
/
usr
/
src
/
lib
/
libc
/
gen
/
ctime.c
diff --git
a/usr/src/lib/libc/gen/ctime.c
b/usr/src/lib/libc/gen/ctime.c
index
ef3e78f
..
fb0b3a7
100644
(file)
--- a/
usr/src/lib/libc/gen/ctime.c
+++ b/
usr/src/lib/libc/gen/ctime.c
@@
-4,9
+4,9
@@
* specifies the terms and conditions for redistribution.
*/
* specifies the terms and conditions for redistribution.
*/
-#if
ndef lint
-static char sccsid[] = "@(#)ctime.c 5.
3
(Berkeley) %G%";
-#endif not lint
+#if
defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)ctime.c 5.
5
(Berkeley) %G%";
+#endif
LIBC_SCCS and
not lint
/*
* This routine converts time as follows.
/*
* This routine converts time as follows.
@@
-159,9
+159,13
@@
time_t *tim;
int year;
time_t copyt;
struct timeval curtime;
int year;
time_t copyt;
struct timeval curtime;
- struct timezone zone;
+ static struct timezone zone;
+ static int init = 0;
- gettimeofday(&curtime, &zone);
+ if (!init) {
+ gettimeofday(&curtime, &zone);
+ init++;
+ }
copyt = *tim - (time_t)zone.tz_minuteswest*60;
ct = gmtime(©t);
dayno = ct->tm_yday;
copyt = *tim - (time_t)zone.tz_minuteswest*60;
ct = gmtime(©t);
dayno = ct->tm_yday;