fixed bug #1536377 - incorrect timestamps on big-endian platforms
instead of messing with structs, use simple arithmetic ops to split the time to low & high words git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4738 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
23bc91327d
commit
71e601f11f
1 changed files with 6 additions and 24 deletions
|
@ -4744,18 +4744,9 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
struct stat st;
|
||||
if (!stat(line.gettoken_str(1), &st))
|
||||
{
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
long l;
|
||||
long h;
|
||||
} words;
|
||||
long long ll;
|
||||
};
|
||||
ll = (st.st_mtime * 10000000LL) + 116444736000000000LL;
|
||||
high = words.h;
|
||||
low = words.l;
|
||||
unsigned long long ll = (st.st_mtime * 10000000LL) + 116444736000000000LL;
|
||||
high = (DWORD) (ll >> 32);
|
||||
low = (DWORD) ll;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -6076,22 +6067,13 @@ int CEXEBuild::add_file(const string& dir, const string& file, int attrib, const
|
|||
struct stat st;
|
||||
if (!fstat(fd, &st))
|
||||
{
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
long l;
|
||||
long h;
|
||||
} words;
|
||||
long long ll;
|
||||
};
|
||||
ll = (st.st_mtime * 10000000LL) + 116444736000000000LL;
|
||||
unsigned long long ll = (st.st_mtime * 10000000LL) + 116444736000000000LL;
|
||||
|
||||
// FAT write time has a resolution of 2 seconds
|
||||
ll -= ll % 20000000;
|
||||
|
||||
ent.offsets[3] = words.l;
|
||||
ent.offsets[4] = words.h;
|
||||
ent.offsets[3] = (int) ll;
|
||||
ent.offsets[4] = (int) (ll >> 32);
|
||||
}
|
||||
#endif
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue