blob: 6f31fe8a1930071905298dc46a4caedd27620b03 (
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
|
$NetBSD: patch-ab,v 1.3 2004/04/10 23:31:27 minskim Exp $
--- arcdos.c.orig 1992-04-14 17:58:21.000000000 -0500
+++ arcdos.c
@@ -31,7 +31,11 @@
#include <sys/types.h>
#include <sys/stat.h>
#if BSD
+#ifdef __linux__
+#include <time.h>
+#else
#include <sys/time.h>
+#endif
#else
#include <time.h> /* Sys V. Bleah. */
struct timeval {
@@ -173,14 +177,21 @@ setstamp(f, date, time) /* set a file's
struct tm tm;
struct timeval tvp[2];
int utimes();
+#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__APPLE__) && !defined(__linux__) && !defined(__sgi__)
long tmclock();
+#endif
tm.tm_sec = (time & 31) * 2;
tm.tm_min = (time >> 5) & 63;
tm.tm_hour = (time >> 11);
tm.tm_mday = date & 31;
tm.tm_mon = ((date >> 5) & 15) - 1;
tm.tm_year = (date >> 9) + 80;
+ tm.tm_isdst = -1;
+#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__APPLE__) && !defined(__linux__) && !defined(__sgi__)
tvp[0].tv_sec = tmclock(&tm);
+#else
+ tvp[0].tv_sec = mktime(&tm);
+#endif
tvp[1].tv_sec = tvp[0].tv_sec;
tvp[0].tv_usec = tvp[1].tv_usec = 0;
utimes(f, tvp);
|