blob: 812790bc878b8bbdb5f93802e08f54467474f8e6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
$NetBSD: patch-ab,v 1.2 2008/07/28 02:45:56 dholland Exp $
--- dtime.c.orig 1991-09-14 01:15:25.000000000 -0400
+++ dtime.c 2008-07-27 22:02:34.000000000 -0400
@@ -19,36 +19,23 @@ static char rcsid[] =
#include <stdio.h>
#include <sys/types.h>
#include <time.h>
-#ifdef SYS5
-extern int daylight;
-extern long timezone;
-#else /*SYS5*/
-#include <sys/timeb.h>
-#endif /*SYS5*/
-
-extern long time();
-struct tm* localtime();
struct tws*
-dtwstime()
+dtwstime(void)
{
- long clock;
+ time_t clock;
(void) time( &clock );
return dlocaltime( &clock );
}
struct tws*
-dlocaltime( clock )
- long* clock;
+dlocaltime( time_t *clock )
{
register struct tm* tm;
-#ifndef SYS5
- struct timeb tb;
-#endif not SYS5
static struct tws tw;
- if ( clock == (long*) 0 )
+ if ( clock == NULL )
return (struct tws*) 0;
tw.tw_flags = TW_NULL;
@@ -63,13 +50,6 @@ dlocaltime( clock )
tw.tw_yday = tm->tm_yday;
if ( tm->tm_isdst )
tw.tw_flags |= TW_DST;
-#ifndef SYS5
- ftime( &tb );
- tw.tw_zone = -tb.timezone;
-#else SYS5
- tzset();
- tw.tw_zone = -( timezone / 60 );
-#endif SYS5
tw.tw_flags &= ~TW_SDAY;
tw.tw_flags |= TW_SEXP;
tw.tw_clock = *clock;
|