From 38572a5d11085e76d9d2e2fa6659e909801495ee Mon Sep 17 00:00:00 2001 From: "blizzard%redhat.com" Date: Wed, 15 Mar 2000 03:08:28 +0000 Subject: [PATCH] fix for bug #18186. remove work around in layout code and properly implement nsIFile::GetLastMofificationDate() on unix. r=vidur,jst,dougt a=waterson git-svn-id: svn://10.0.0.236/trunk@62992 18797224-902f-48f8-a5cc-f745e15eee43 --- .../content/html/document/src/nsHTMLDocument.cpp | 13 +------------ mozilla/layout/html/document/src/nsHTMLDocument.cpp | 13 +------------ mozilla/xpcom/io/nsLocalFileUnix.cpp | 9 +++++++-- 3 files changed, 9 insertions(+), 26 deletions(-) diff --git a/mozilla/content/html/document/src/nsHTMLDocument.cpp b/mozilla/content/html/document/src/nsHTMLDocument.cpp index 53e362fbf7d..6dfd0f6a915 100644 --- a/mozilla/content/html/document/src/nsHTMLDocument.cpp +++ b/mozilla/content/html/document/src/nsHTMLDocument.cpp @@ -507,19 +507,8 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand, if (NS_FAILED(rv)) { return rv; } PRExplodedTime prtime; char buf[100]; - PRInt64 prusec, scale; - -#ifdef XP_PC - LL_I2L(scale, 1L); -#else - // nsIFile->GetLastModificationDate() uses stat on Unix and not - // PRFileInfo64() to get the modification date, untill that is changed - // we haveto do different scaling to get the date right. - LL_I2L(scale, 1000000L); -#endif - LL_MUL(prusec, modDate, scale); - PR_ExplodeTime(prusec, PR_LocalTimeParameters, &prtime); + PR_ExplodeTime(modDate, PR_LocalTimeParameters, &prtime); // Use '%#c' for windows, because '%c' is backward-compatible and // non-y2k with msvc; '%#c' requests that a full year be used in the diff --git a/mozilla/layout/html/document/src/nsHTMLDocument.cpp b/mozilla/layout/html/document/src/nsHTMLDocument.cpp index 53e362fbf7d..6dfd0f6a915 100644 --- a/mozilla/layout/html/document/src/nsHTMLDocument.cpp +++ b/mozilla/layout/html/document/src/nsHTMLDocument.cpp @@ -507,19 +507,8 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand, if (NS_FAILED(rv)) { return rv; } PRExplodedTime prtime; char buf[100]; - PRInt64 prusec, scale; - -#ifdef XP_PC - LL_I2L(scale, 1L); -#else - // nsIFile->GetLastModificationDate() uses stat on Unix and not - // PRFileInfo64() to get the modification date, untill that is changed - // we haveto do different scaling to get the date right. - LL_I2L(scale, 1000000L); -#endif - LL_MUL(prusec, modDate, scale); - PR_ExplodeTime(prusec, PR_LocalTimeParameters, &prtime); + PR_ExplodeTime(modDate, PR_LocalTimeParameters, &prtime); // Use '%#c' for windows, because '%c' is backward-compatible and // non-y2k with msvc; '%#c' requests that a full year be used in the diff --git a/mozilla/xpcom/io/nsLocalFileUnix.cpp b/mozilla/xpcom/io/nsLocalFileUnix.cpp index d80d381d302..cb5c1a66b26 100644 --- a/mozilla/xpcom/io/nsLocalFileUnix.cpp +++ b/mozilla/xpcom/io/nsLocalFileUnix.cpp @@ -776,8 +776,13 @@ NS_IMETHODIMP nsLocalFile::GetLastModificationDate(PRInt64 *aLastModificationDate) { NS_ENSURE_ARG(aLastModificationDate); - VALIDATE_STAT_CACHE(); - mLL_II2L(0, (PRUint32)mCachedStat.st_mtime, *aLastModificationDate); + CHECK_mPath(); + PRFileInfo64 info; + if (PR_GetFileInfo64(mPath, &info) != PR_SUCCESS) { + return NSRESULT_FOR_ERRNO(); + } + // PRTime is a 64 bit value + *aLastModificationDate = info.modifyTime; return NS_OK; }