$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 #include #if BSD +#ifdef __linux__ +#include +#else #include +#endif #else #include /* Sys V. Bleah. */ #if NEED_TIMEVAL @@ -52,6 +56,11 @@ struct timeval { char *malloc(); #endif +#if defined(__INTERIX) +#define NO_UTIMES +#include +#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