mirror of
https://github.com/cc65/cc65.git
synced 2025-01-12 02:30:44 +00:00
Use the replacement function to set file times.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5638 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
a0c6ae2c62
commit
7287d86dd1
@ -35,19 +35,12 @@
|
||||
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#if defined(__WATCOMC__) || defined(_MSC_VER) || defined(__MINGW32__)
|
||||
/* The Windows compilers have the file in the wrong directory */
|
||||
# include <sys/utime.h>
|
||||
#else
|
||||
# include <sys/types.h> /* FreeBSD needs this */
|
||||
# include <utime.h>
|
||||
#endif
|
||||
#include <time.h>
|
||||
|
||||
/* 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));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user