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
60
|
$NetBSD: patch-ab,v 1.5 2006/05/02 19:06:45 wiz Exp $
--- arcdos.c.orig 2003-10-31 03:32:19.000000000 +0100
+++ 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. */
#if NEED_TIMEVAL
@@ -52,6 +56,11 @@ struct timeval {
char *malloc();
#endif
+#if defined(__INTERIX)
+#define NO_UTIMES
+#include <utime.h>
+#endif
+
VOID
getstamp(f, date, time) /* get a file's date/time stamp */
#if !_MTS
@@ -173,20 +182,29 @@ setstamp(f, date, time) /* set a file's
#endif
#if UNIX
struct tm tm;
+#ifdef NO_UTIMES
+ struct utimbuf utb;
+#else
struct timeval tvp[2];
+#endif
int utimes();
- long tmclock();
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;
- tvp[0].tv_sec = tmclock(&tm);
+ tm.tm_isdst = -1;
+#ifdef NO_UTIMES
+ utb.actime = utb.modtime = mktime(&tm);
+ utime(f, &utb);
+#else
+ tvp[0].tv_sec = mktime(&tm);
tvp[1].tv_sec = tvp[0].tv_sec;
tvp[0].tv_usec = tvp[1].tv_usec = 0;
utimes(f, tvp);
#endif
+#endif
}
#if MSDOS
|