Bug 540545 - NS_ERROR is very annoying in X86 maemo builds. r=dougt
authorOleg Romashin <romaxa@gmail.com>
Thu, 18 Feb 2010 23:52:54 +0200
changeset 38298 cbba91f5de0148213b11c438c7a4f36093da3fd7
parent 38297 c61d3ed9a0155ac3cb6bbbc42a62c0a25fe803d6
child 38299 aec695f100038fea48518457753bb6426c33c681
push idunknown
push userunknown
push dateunknown
reviewersdougt
bugs540545
milestone1.9.3a2pre
Bug 540545 - NS_ERROR is very annoying in X86 maemo builds. r=dougt
xpcom/base/nsMemoryImpl.cpp
--- a/xpcom/base/nsMemoryImpl.cpp
+++ b/xpcom/base/nsMemoryImpl.cpp
@@ -52,17 +52,17 @@
 #include "nsAutoLock.h"
 #include "nsCOMPtr.h"
 #include "nsString.h"
 
 #if defined(XP_WIN)
 #include <windows.h>
 #endif
 
-#if defined(MOZ_PLATFORM_MAEMO)
+#if defined(MOZ_PLATFORM_MAEMO) && defined(__arm__)
 #include <osso-mem.h>
 #include <fcntl.h>
 #include <unistd.h>
 static const char kHighMark[] = "/sys/kernel/high_watermark";
 #endif
 
 // Some platforms notify you when system memory is low, others do not.
 // In the case of those that do not, we want to post low memory
@@ -123,17 +123,17 @@ nsMemoryImpl::IsLowMemory(PRBool *result
     // Bug 525323 - GlobalMemoryStatus kills perf on WinCE.
     *result = PR_FALSE;
 #elif defined(XP_WIN)
     MEMORYSTATUSEX stat;
     stat.dwLength = sizeof stat;
     GlobalMemoryStatusEx(&stat);
     *result = (stat.ullAvailPageFile < kRequiredMemory) &&
         ((float)stat.ullAvailPageFile / stat.ullTotalPageFile) < 0.1;
-#elif defined(MOZ_PLATFORM_MAEMO)
+#elif defined(MOZ_PLATFORM_MAEMO) && defined(__arm__)
     static int osso_highmark_fd = -1;
     if (osso_highmark_fd == -1) {
         osso_highmark_fd = open (kHighMark, O_RDONLY);
 
         if (osso_highmark_fd == -1) {
             NS_ERROR("can't find the osso highmark file");    
             *result = PR_FALSE;
             return NS_OK;