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:
@@ -35,19 +35,12 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.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 */
|
/* common */
|
||||||
#include "cddefs.h"
|
#include "cddefs.h"
|
||||||
#include "exprdefs.h"
|
#include "exprdefs.h"
|
||||||
#include "filestat.h"
|
#include "filestat.h"
|
||||||
|
#include "filetime.h"
|
||||||
#include "fname.h"
|
#include "fname.h"
|
||||||
#include "symdefs.h"
|
#include "symdefs.h"
|
||||||
#include "xmalloc.h"
|
#include "xmalloc.h"
|
||||||
@@ -309,7 +302,6 @@ void ObjAdd (const char* Name)
|
|||||||
void ObjExtract (const char* Name)
|
void ObjExtract (const char* Name)
|
||||||
/* Extract a module from the library */
|
/* Extract a module from the library */
|
||||||
{
|
{
|
||||||
struct utimbuf U;
|
|
||||||
FILE* Obj;
|
FILE* Obj;
|
||||||
|
|
||||||
/* Make a module name from the file name */
|
/* Make a module name from the file name */
|
||||||
@@ -340,9 +332,7 @@ void ObjExtract (const char* Name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Set access and modification time */
|
/* Set access and modification time */
|
||||||
U.actime = O->MTime;
|
if (SetFileTimes (Name, O->MTime) != 0) {
|
||||||
U.modtime = O->MTime;
|
|
||||||
if (utime (Name, &U) != 0) {
|
|
||||||
Error ("Cannot set mod time on `%s': %s", Name, strerror (errno));
|
Error ("Cannot set mod time on `%s': %s", Name, strerror (errno));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user