зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset d40105caed00 (bug 1906405) for causing xpcshell failures on test_localfile. CLOSED TREE
This commit is contained in:
Родитель
5dc17eb22a
Коммит
8fbb81f010
|
@ -634,9 +634,6 @@ static nsresult GetFileInfo(const nsString& aName,
|
|||
aInfo->size = fileData.nFileSizeHigh;
|
||||
aInfo->size = (aInfo->size << 32) + fileData.nFileSizeLow;
|
||||
|
||||
// modifyTime must be initialized before creationTime refers it.
|
||||
FileTimeToPRTime(&fileData.ftLastWriteTime, &aInfo->modifyTime);
|
||||
|
||||
if (0 == fileData.ftCreationTime.dwLowDateTime &&
|
||||
0 == fileData.ftCreationTime.dwHighDateTime) {
|
||||
aInfo->creationTime = aInfo->modifyTime;
|
||||
|
@ -645,6 +642,7 @@ static nsresult GetFileInfo(const nsString& aName,
|
|||
}
|
||||
|
||||
FileTimeToPRTime(&fileData.ftLastAccessTime, &aInfo->accessTime);
|
||||
FileTimeToPRTime(&fileData.ftLastWriteTime, &aInfo->modifyTime);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -2391,11 +2389,17 @@ nsresult nsLocalFile::GetDateImpl(PRTime* aTime,
|
|||
FileInfo* pInfo;
|
||||
|
||||
if (aFollowLinks) {
|
||||
MOZ_TRY(ResolveAndStat());
|
||||
pInfo = &mFileInfo;
|
||||
} else {
|
||||
MOZ_TRY(GetFileInfo(mWorkingPath, &symlinkInfo));
|
||||
if (nsresult rv = GetFileInfo(mWorkingPath, &symlinkInfo); NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
pInfo = &symlinkInfo;
|
||||
} else {
|
||||
if (nsresult rv = ResolveAndStat(); NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
pInfo = &mFileInfo;
|
||||
}
|
||||
|
||||
switch (aTimeField) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче