From: uz Date: Tue, 3 Apr 2012 13:13:28 +0000 (+0000) Subject: Use the replacement function to set file times. X-Git-Tag: V2.14~429 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7287d86dd1524544c1721f32fc5e18e43393fab2;p=cc65 Use the replacement function to set file times. git-svn-id: svn://svn.cc65.org/cc65/trunk@5638 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/ar65/objfile.c b/src/ar65/objfile.c index c197b0c91..1d52f7061 100644 --- a/src/ar65/objfile.c +++ b/src/ar65/objfile.c @@ -35,19 +35,12 @@ #include #include -#if defined(__WATCOMC__) || defined(_MSC_VER) || defined(__MINGW32__) -/* The Windows compilers have the file in the wrong directory */ -# include -#else -# include /* FreeBSD needs this */ -# include -#endif -#include /* common */ #include "cddefs.h" #include "exprdefs.h" #include "filestat.h" +#include "filetime.h" #include "fname.h" #include "symdefs.h" #include "xmalloc.h" @@ -309,7 +302,6 @@ void ObjAdd (const char* Name) void ObjExtract (const char* Name) /* Extract a module from the library */ { - struct utimbuf U; FILE* Obj; /* Make a module name from the file name */ @@ -340,9 +332,7 @@ void ObjExtract (const char* Name) } /* Set access and modification time */ - U.actime = O->MTime; - U.modtime = O->MTime; - if (utime (Name, &U) != 0) { + if (SetFileTimes (Name, O->MTime) != 0) { Error ("Cannot set mod time on `%s': %s", Name, strerror (errno)); } }