--- ray/src/common/fdate.c 2003/02/25 02:47:21 2.6 +++ ray/src/common/fdate.c 2019/02/27 21:30:01 2.10 @@ -1,21 +1,27 @@ #ifndef lint -static const char RCSid[] = "$Id: fdate.c,v 2.6 2003/02/25 02:47:21 greg Exp $"; +static const char RCSid[] = "$Id: fdate.c,v 2.10 2019/02/27 21:30:01 greg Exp $"; #endif /* * Return file date (UNIX seconds as returned by time(2) call) * - * External symbols declared in standard.h + * External symbols declared in rtio.h */ #include "copyright.h" -#include +#include "rtio.h" #include +#if defined(_WIN32) || defined(_WIN64) +#include +#else +#include +#endif time_t -fdate(fname) /* get file date */ -char *fname; +fdate( /* get file date */ +char *fname +) { struct stat sbuf; @@ -27,13 +33,14 @@ char *fname; int -setfdate(fname, ftim) /* set file date */ -char *fname; -long ftim; +setfdate( /* set file date */ +char *fname, +long ftim +) { - time_t ftm[2]; + struct utimbuf utb; - ftm[0] = ftm[1] = ftim; + utb.actime = utb.modtime = ftim; - return(utime(fname, ftm)); + return(utime(fname, &utb)); }